NGromann / SwiftHtmlPdf

Generate HTML and PDF documents by using template html files and filling them with your data
MIT License
8 stars 3 forks source link

Question: long tables and page break #7

Closed alexandru-g closed 1 year ago

alexandru-g commented 2 years ago

Did you find a solution to stop table rows from being split on a page break?

NGromann commented 2 years ago

Hi, first of all sorry for the late response. While I have not tested this before, I think that the css styles page-break-before or page-break-after should be able to help here. So you would need to define those on the table or row classes to tell the converter where to insert page breaks.

Here are some resources on this: https://css-tricks.com/almanac/properties/p/page-break/ https://stackoverflow.com/questions/8712677/how-to-apply-css-page-break-to-print-a-table-with-lots-of-rows