I need to do this trick while printing huge HTML tables:
+-----+---------+-----+
| ID | Title | Qty | ⇐ descriptive header that shouldn't repeat
+-----+---------+-----+
| 1 | 2 | 3 | ⇐ column number that **SHOULD** repeat
+-----+---------+-----+
| aaa | bbb | 0 | ⇐ data; rows upon rows of data
... ... ...
+-----+---------+-----+
| 1 | 2 | 3 | ⇐ page 2
+-----+---------+-----+
| xxx | yyy | 999 |
... ... ...
Is it possible to implement without resorting to “2 tables with fixed layout” solution (I really don’t want to use fixed values)? Oh, and I can only use HTML and CSS.
If it helps, I only target IE (6 and up).
More info
So far, I’ve tried these different hacks, but to no avail:
-
no
thead, second row getsthinstead oftd1.1. even with
style="display:table-header-group"on thattr -
in
thead, usingtdinstead ofthfor the first row2.1. using
style="display:table-row-group"ontheadandstyle="display:table-header-group"on the second row in it -
variations of inserting
theadin the middle oftbody(as per one of the answers that disappeared)
I’m starting to accept that it isn’t possible and that I’ll have to resort to that fixed layout setup (but I pray that leaving only one flexible-width column will be enough) 🙁
As it turns out, you can’t do this kind of thing.
The closest solution depending on your requirement will be to use two fixed-layout tables upon each other OR to hard-break the table in parts guaranteed to be fitting on one page.