6

I'm trying to figure out how to get a set of table headers to repeat on each page of output from htmldoc. I plugged in the CSS way (below) to see if that would work, but I don't believe htmldoc does much of anything with CSS.

The basic question is: Is there a way to make htmldoc act like this CSS when outputting to a PDF?

thead {display: table-header-group;}
Jack M.
  • 30,350
  • 7
  • 55
  • 67

1 Answers1

2

HTMLDOC does not support HTML 4.0 elements, attributes, stylesheets, or scripting.

HTMLDOC is very limited. So you must do that by hand. Calculate when the page break on your table (and force it with ) and repeat the header table.
Or use an another tool for that . Have you tried xhtml2pdf : https://github.com/xhtml2pdf/xhtml2pdf . It supports css and have an repeat attribute that do this job for table when page break.

yboussard
  • 245
  • 2
  • 4
  • Perfect answer, and true, you must be precise with your HTML 3.0, and believe me, you can do a whole lot of pretty cool stuff if you keep it simple and clean. The hardest part is taking the time to figure out the actual dimensions of a printable single-page document, as in the width and height of the HTML. Once you have that, well its all a piece of cake, within reason of course, for cool designs require lots of intricate HTML tables and the like. – DoctorLouie Jan 19 '17 at 08:54
  • I've been using HTMLDOC for over a decade now, if I recall correctly, so yeah, its definitely one of those things I can't do without :) – DoctorLouie Jan 19 '17 at 08:55