Preventing Page Breaks Within Table Rows
In HTML, page breaks inside table rows can become a nuisance when converting to PDF using wkhtmltopdf. While setting page-break-inside: avoid with the table often resolves the issue, it can cease to work with excessive rows.
To overcome this limitation, an alternative CSS approach is available:
<table class="print-friendly"> <!-- The rest of your table here --> </table> <style> table.print-friendly tr td, table.print-friendly tr th { page-break-inside: avoid; } </style>
Directly applying most CSS rules to
The above is the detailed content of How to Prevent Page Breaks Inside Table Rows When Converting HTML to PDF?. For more information, please follow other related articles on the PHP Chinese website!