2

I'm using node-html-pdf to generate pdfs. It renders HTML then uses phantom js to convert to pdf.

I have several tables that overrun a single page in the pdf, and I'd like the table header to repeat on each new page.

From what I can tell, this should work from a standard browser, but i'm not having any luck with node-html-pdf

Also, the pdf is in landscape.

css

table {
  page-break-after: always;
}
tr {
  page-break-inside: avoid;
}
table tr {
  break-inside: avoid !important;
}
thead {display: table-header-group !important;}
tbody {display: table-row-group !important;}
tfoot {display: table-header-group !important;}
rbristow
  • 183
  • 2
  • 15

1 Answers1

0

set the id of your table header

<thead id="pageHeader">

if you want to set another headers on your other pages you can do it visit official documentation https://www.npmjs.com/package/html-pdf