These rules work in Chromium-based renderers: Chrome's Print to PDF, Puppeteer, Playwright and APIs built on them, including SlipKiln. Older engines like wkhtmltopdf support less of this.
Tables split across pages
Long tables get rows cut in half at the page edge, and the header row appears only on page one. Two rules fix both:
/* Keep each row whole and repeat the header row on every page */ tr { break-inside : avoid ; } thead { display : table-header-group ; } tfoot { display : table-footer-group ; }
Enter fullscreen mode
Exit fullscreen mode
Chromium repeats a <thead> on every printed page, so make sure your header row is actually in a <thead> , not the first <tr> of the body.…