Css, Printer Friendly Pages & Page Breaks

I’m working on a user list at work, and one requirement is a printer friendly version, listing one user per page. What I’ve done in the past is have the user click on a button to download a .doc file with End Of Page characters embedded in it. Word would oblige by skipping to a new page.
I decided for this application I wanted to go the CSS route to printing.
All the “Printer Friendly Pages with CSS” tutorials were useless when it came to inserting page breaks, but after a bit of searching on Google (mainly because I didn’t use the term ‘page break’) but I eventually came across this thread on devshed.

<P ID=”break”>some content</P>

This will print a page break after the text some content!
Now I have a really nice web based list of users, and hitting print on the browser produces a neat pile of pages, one user per page.
I also found a bug in Mozilla Firebird! While in “Print Preview” mode, refresh the page using ctrl-r. It’ll bring up the original page but will keep the browser in the preview mode! Yes, I’ll take a look in Bugzilla for it tomorrow. I’m off home now!

By Donncha

Donncha Ó Caoimh is a software developer at Automattic and WordPress plugin developer. He posts photos at In Photos and can also be found on Twitter.

1 reply on “Css, Printer Friendly Pages & Page Breaks”

Leave a Reply