Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does `page-break-before` CSS property work?

According to DOMPDF's FAQ, you can use page-break-before and the similar to force page breaks.

I had to lay out my page with tables, as DOMPDF does not support floats.

On a <tr> element, I have placed style="page-break-before: always" but the generated PDF doesn't seem to follow this rule.

Is it because I have placed it on a tr element, and not a traditional block element?

Am I doing something wrong?

Thanks.

like image 599
alex Avatar asked Jul 16 '10 06:07

alex


1 Answers

I ended up solving it by

  • closing the table I was in
  • adding a <div style="page-break-before: always;"></div>
  • reopening the table
like image 163
alex Avatar answered Sep 23 '22 20:09

alex