April 29, 2012

Page Breaks in HTML

Page break after description

Fixing page breaks just after a title when printing HTML.
Used an XSLT transform to break my document into sections each with a title. Trouble is when printing HTML, there is no way to know where the page break will be placed. In my case I ended up with page breaks just after a section title!. Fixed this by putting a <br style="page-break-after:always"/> at the end of each section. There are other types of page break in CSS but this fixed the problem and quickly. Some browsers do not accept all forms of page break; Firefox, for example.

No comments: