Shahil Shahil - 4 months ago 25
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.


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; }