I am using TCPDF and using the writeHTML function to create a PDF as follows:
$html = 'html content';
$pdf->writeHTML($html, true, false, true, false, '');
I have sections of content, and each section is in a div and a table, since the page and content automatically go to the next page, sometimes I get very few lines of my content on one page, and the rest on the next page.
Is there a way in TCPDF to tell it to make sure all the contents of a div or table should be together? so if he needs to go to the next page, should he take the whole div to the next page?
thank
* UPDATE *
As olger said, the "page-break-inside" style attribute works and does the following work:
<div style="page-break-inside:avoid;">
HTML grouped content
</div>
source
share