TR {page-break-inside: avoid} CSS definition is intended to protect table rows from being broken.
PD4ML also provides a limited experimental support for table header replication:
You need to invoke
pd4ml.enableTableBreaks(true) method (or to set
enableTableBreaks attribute of
<pd4ml:transform>) - it implicitly defines
page-break-inside: avoid for
<tr> elements and replicates the table heading row(s) to the tops of all table parts. (
heading row there is a row, which consists of <th> elements only)
In both of the cases the table border and the table background can not reflect the splits on <tr> level. So the best way is to disable the table border and background and to define borders and background colors for single cells.
TD { border: 1px solid red }
TABLE { border: none; border-collapse: collapse }