Forum How do I...?

Table header and footer only once

mn4367
I'm sure this should be quite simple, but I could find any solution for this problem. I have a table with a thead and a table caption (below the table) and I'd like to have the following behaviour:

Case 1 (table fits on one page, no problem here):

Table header (<thead>)
--------------------
Table row
Table row
Table row
Table row
--------------------
Table caption (<caption>)


Case 2 (same as case 1 but with a very long table with one or more page
breaks in the table, or table doesn't fit on the curent page):


Table header
--------------------
Table row
Table row
...
-----------------------------------   <- page break
Table row
Table row
...
Table row
Table row
...
-----------------------------------   <- page break
Table row
Table row
--------------------
Table caption


So I've actually two questions

- How can I have a table header appear only at the beginning of the table, not on subsequent pages?
- How can I have a caption only at the end of the table, not repeated on subsequent pages?

I know that I could simulate this with divs for the table header and the caption together with a table that doesn't use thead and caption at all, but that violates the sematics of a table too much in my opinion.

And it wouldn't be easy since the HTML is generated by a Markdown processor.

Thanks!
mikeday
At the moment you need to use divs, as there is no CSS mechanism for controlling the repetition of table headers and footers.
mn4367
OK, thanks.

Isn't that a bit strange? I thought that this is a common use case. Any chance that this can be added to Prince with some prince-* properties?
mikeday
I think this is the first time it has come up, actually. We have had requests for changing the content of headers/footers on following pages.

I can add this to the roadmap, but we might not get to it for a while, as the roadmap is very long. :)
mn4367
Yes, I saw the roadmap... :-)

Not really a big problem for me, I think I can get around it with a DOM parser or some XSLT. But I think it would be worth putting it on the roadmap or even propose it for the CSS spec.

Thanks.
perry
Is this issue addressed yet? The header and footer for a table are repeating if the table spans to the next page