How to add page breaks to html

February, 8 2012

We often get the question about creating HTML that sends proper page breaks to the printer.

It's actually very easy to handle. There are two ways to do it:

1) via CSS - for the advanced HTML users:

<p style="page-break-after:always;"></p>

2) with a simple comment:

<p><!-- pagebreak --></p> 

For example, if you try printing this page (try Chrome print preview) the line below should be on a second page:

Page break below this line.

This line should be on the top of the second page.

That's it.

Comments

10/22/2012 01:57 / anonymous said:
thanks
11/30/2013 08:00 / SeFun said:
Thank you!
04/20/2014 11:38 / bam said:
Neither method works on Chrome
(at least, not on print preview).
04/27/2014 03:09 / Fred said:
Hi,

I put the following code in between two Panels: (Tried all three separately... on 2 different printers) and still no page break... what am I missing?

E.g. My simple request:
06/25/2014 22:12 / LVSYS said:
Make sure to type the CSS and the HTML without typos. It works. Try it on Chrome print preview

Post A Comment

We'd love to hear your thougts. All comments are subject to administrator approval before appearing on this website. All comments of spammy nature are automatically rejected.

Name:
Email Address: (will not be displayed)
Comment
Captcha

Signup For Newsletter

Email Address: