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.

#break
{
PAGE-BREAK-AFTER: always;
}
…..
<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!

One thought on “Css, Printer Friendly Pages & Page Breaks

Leave a Reply

%d bloggers like this:

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close