{"id":238,"date":"2004-12-08T23:20:00","date_gmt":"2004-12-08T23:20:00","guid":{"rendered":"http:\/\/jclark.org\/weblog\/WebDev\/Browsers\/firefoxprint.html"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-30T04:00:00","slug":"firefoxprint","status":"publish","type":"post","link":"https:\/\/jclark.org\/weblog\/2004\/12\/08\/firefoxprint\/","title":{"rendered":"Firefox Printing"},"content":{"rendered":"<p>Earlier today I wanted to print a web page for some offline reading.  It was a page from a blog, featuring a left-handed nav\/info bar and content on the right.  Of course, I only wanted to print the content area.  I tried printing, hoping for a print stylesheet that would supress the navbar.  No such luck (note to self:  implement a print stylesheet for your own glass house, and put down that stone).<\/p>\n<p>I then tried turning off styles, figuring I could omit the pages of the printout which contained the navbar.  I was surprised to find that [Firefox][1] prints using the default style sheet when styles are turned off (View|Page Style|No Style) (note to self:  check [Bugzilla][2], report if needed).  <\/p>\n<p>I considered adding a user stylesheet, hoping that it would cascade with the existing stylesheet.  In trying to figure out what my stylesheet should do, I used the DOM inspector.  I was disappointed to find the layout used a 1 row `<\/p>\n<table>` with with 2 `<td>`s to achieve layout (note to self:  you don&#8217;t do that- good job).  No wories, judicious use of a following sibling CSS selector did the job:\n\n    td {display:none} \/* don&#8217;t show \n<\/td><td>s *\/\n    td+td {display:block} \/* okay, show \n<\/td><td>s that follow another td *\/\n\nThe net affect is that only the first `\n<\/td><td>` (in each `<\/td><tr>`) is hidden.  Perfect for this application.  I tested this CSS snippet using the Edit CSS feature of fantastic the [Web Developer Toolbar][3].  On a whim, I tried printing, and was pleased to see that Firefox printed using the edited CSS.\n\n**Update:** I dutifully checked Bugzilla.  [Bug 260762][4] looks like a match.\n\n[1]: http:\/\/getfirefox.com\n[2]: http:\/\/bugzilla.mozilla.org\n[3]: http:\/\/www.chrispederick.com\/work\/firefox\/webdeveloper\/    \n[4]: https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=260762<\/tr><\/table>","protected":false},"excerpt":{"rendered":"<p>Earlier today I wanted to print a web page for some offline reading. It was a page from a blog, featuring a left-handed nav\/info bar and content on the right. Of course, I only wanted to print the content area. I tried printing, hoping for a print stylesheet that would supress the navbar. No such [&hellip;]<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-238","post","type-post","status-publish","format-standard","hentry","category-browsers"],"_links":{"self":[{"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/posts\/238","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/comments?post=238"}],"version-history":[{"count":0,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/posts\/238\/revisions"}],"wp:attachment":[{"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/media?parent=238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/categories?post=238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/tags?post=238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}