Shahil Shahil - 1 year ago 73
CSS Question

Pagebreak for contents in pdf and print

I have a html which will be generated to pdf. I have few tables in that. How can i break the content to next page if the content is big ?

I have tried using the

but had no effect.

Answer Source

The below rules can help you add page break for tables.

   table { page-break-inside:auto }
   tr    { page-break-inside:avoid; page-break-after:auto }

Or try adding a div as:

<div class="page-break"></div>

with styles:

@media all {
    .page-break { display: none; }

@media print {
    .page-break { display: block; page-break-before: always; }
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download