Fog Creek Software
Discussion Board




Javascript question

Anyone know how to force a page break when printing from JavaScript?  I have an 8 page dynamic document that i want to print, but keep the page integrity. 

Christopher Hester
Thursday, June 26, 2003

It's possible to define page break points using CSS, but browser support isn't unversal.

If you wanted every H1 element to start a new page, for example:

        H1 { page-break-before: always; }

For more information, check out Section 13 [1] of the CSS2 spec [2].

[1] http://www.w3.org/TR/REC-CSS2/page.html
[2] http://www.w3.org/TR/REC-CSS2/cover.html

John Barnette
Thursday, June 26, 2003

Thanks, this works perfectly.  CSS is great.  CSS is great.  That was intentional.

Christopher Hester
Thursday, June 26, 2003

*  Recent Topics

*  Fog Creek Home