How do I add a Page Break page to a Print page?

The content on the print page has one long, but so far we are printing some content of the text cut out.

alt text http://img694.imageshack.us/img694/6766/printpage.jpg

please let me know if there is any dynamic way to add CSS page break. content can be any.

+6
javascript jquery css
source share
5 answers

yes, this article explains:

http://davidwalsh.name/css-page-breaks

+7
source share

As Chaim Evgi mentioned in this article http://davidwalsh.name/css-page-breaks

In addition to what is already described in this article, I would like to point out that it is good practice to use .page-break-before: auto instead of .page-break-before: always. "Auto" breaks the page only if the content is at the end of the page, this will prevent page breaks and leave a lot of free space.

CSS

@media all { .page-break { display: none; } } @media print { .page-break { display: block; page-break-before: auto; } } 

HTML

 <div>some content</div> <div class="page-break">more content, this content may be short or long</div> <div class="page-break">this content may page-break if content above this <div> is at the end of the page</div> <div class="page-break">etc,..</div> 
+2
source share

Use the css page-break-before and page-break-after elements.

+1
source share

Ok, I found something that worked, its a bit of JS, but it seems like a trick. Here's the link: Specifying page breaks for printing using CSS

0
source share

You can also simply prevent page breaks inside an element.

eg. Short tables you don’t want to break when printing:

 @media print { table { page-break-inside: avoid; } } 
0
source share

All Articles