Repeating table headers or recursive pagination
I often have situations where I want to display tabular data which doesn't fit on one page. It would be good for readability if the table header could be repeated on each new page.
I'm starting this discussion because I'd like some input on how to achieve this, maybe I am ignoring something obvious from the polyfill or paged media standard. Mostly I am talking about automatically generated content which means I would like to avoid manual tweaks for individual cases.
The only thing I can see is to create a new page class with the table header as background or generated content. But that limits what I can do with the header, the table has to start at the top of a page instead of flowing after other content, and also I think there can't be other content after the table on the same page if space is left. The latter may be achieved through attaching a page class to the trailing content and hope it is overwritten by the table's page class if both appear on the same page. Getting all of this done with regular HTML table markup and generic enough for dynamically generated content and dynamically sized rows is even trickier.
The other way to think about this problem is something like recursive pagination: The table is represented as a box, and if that box has to be split among multiple pages, it would need to be able to generate additional content which isn't bound to the page but rather to the sub-page. Ideally it could have a table header at the start of the table flowing after other content, and maybe even a footer element at the final end of the table followed by other content. Ideally it would also be able to finetune the pagination (orphans, widows, page-break-before/inside/after etc).
A similar use case would be where there are two or more independent flows of content on the same sequence of pages. Like a set of pictures with one on each top of a page and a story text on the bottom. This could also be achieved through defining different page types, but it would be very verbose and not very generic.
Yet another idea is to use the CSS Houdini Layout API, but I haven't looked into that enough, yet.
I welcome any suggestions on how to do things like that, And thank you all for your great work on paged media!