Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable table header repeating on page break when rendering as PDF

PhantomJS seems to have issues with trying to make the table headers repeat on page breaks; the headers are sometimes in the wrong place, or they collide with existing content. I'm wondering if there is a way to disable table-header repeating on page-breaks, so that I can avoid this problem entirely?

like image 604
jumbopap Avatar asked Mar 10 '14 20:03

jumbopap


People also ask

How do you repeat a header on each page in HTML?

This can be done setting a CSS property for the thead element of the html table. The property that needs to be set is: display: table-header-group. The following html table will repeat the table header at the top of each pdf page when converted to pdf.


1 Answers

This is a tricky, But i solved it using simple logic. Cast table element to display as a Block element and it works.

display:block;
page-break-inside:avoid;
like image 186
Tunde Pizzle Avatar answered Sep 26 '22 05:09

Tunde Pizzle