You can style elements with
page-break-inside: avoid; to tell dompdf to avoid using a page break inside an element. Implementation of this declaration isn't perfect. It currently doesn't work on table elements. But if you style a container div it should work ok. Something like this:
<div style="page-break-inside: avoid;">
<table>...</table>
</div>
The other problem is more important to take note of. If you style an element this way and it's larger than one page then dompdf could enter an infinite loop attempting to render the element. This is one of the issues we're trying to correct for the stable 0.6.0 release. I don't think you'll have an issue for this particular setup, but it's something to keep in mind.
On Monday, July 23, 2012 5:56:51 PM UTC-4, Evan Anderson wrote:
Is there the ability to define when a page break happens based on wether of not the element would span a page break? For example, if a table was going to be split across 2 pages, then insert a page break before the table is rendered. I am aware that I could add page breaks for every table, but thats not the ideal solution as this would create a new page for every table regardless of its size and position within the content.
Much appreciated,
- Evan