diff --git a/IPython/html/static/notebook/less/cell.less b/IPython/html/static/notebook/less/cell.less
index ed4ad4a..f24a868 100644
--- a/IPython/html/static/notebook/less/cell.less
+++ b/IPython/html/static/notebook/less/cell.less
@@ -21,6 +21,13 @@ div.cell {
outline: none;
}
+/* Don't border the cells when printing */
+@media print {
+ div.cell {
+ border-color: transparent !important;
+ }
+}
+
div.prompt {
/* This needs to be wide enough for 3 digit prompt numbers: In[100]: */
min-width: 15ex;
diff --git a/IPython/html/static/notebook/less/codecell.less b/IPython/html/static/notebook/less/codecell.less
index 983e97a..97a34ba 100644
--- a/IPython/html/static/notebook/less/codecell.less
+++ b/IPython/html/static/notebook/less/codecell.less
@@ -1,4 +1,8 @@
-div.code_cell {
+/* avoid page breaking on code cells when printing */
+@media print {
+ div.code_cell {
+ page-break-inside: avoid;
+ }
}
/* any special styling for code cells that are currently running goes here */
diff --git a/IPython/html/static/notebook/less/notebook.less b/IPython/html/static/notebook/less/notebook.less
index 58ac2df..a4727fb 100644
--- a/IPython/html/static/notebook/less/notebook.less
+++ b/IPython/html/static/notebook/less/notebook.less
@@ -91,3 +91,10 @@ p {
.notebook_app #header {
.box-shadow(@notebook-shadow);
}
+
+/* Hide the header when printing */
+@media print {
+ #header, #header-spacer {
+ display: none !important;
+ }
+}