avoid page break inside row of table

You might try this with CSS:

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

Most CSS rules don’t apply to <tr> tags directly, because of exactly what you pointed out above – they have a unique display style, which doesn’t allow for these CSS rules. However, the <td> and <th> tags within them usually do allow this kind of specification – and you can easily apply such rules to ALL child-<tr>‘s and <td>‘s using CSS as shown above.

Leave a Comment