How to keep HTML table rows undivided by page breaks when printing HTML into PDF?

When printing large HTML tables it happens that a row gets wrongly divided between two pages. In order to solve this we can instruct the printer to keep the row on only one of the pages by adding CSS style to the table row.:

When page-break-inside property is set to avoid the  page-break should be avoided inside a HTML element, in this case table row. Of course ti can be applied to other elements like pre, blockquote, etc.
tr{
     page-break-inside:avoid;
     page-break-after:auto
}


No comments:

Post a Comment