How to repeat table header on new page


did anyone manage to create PDFs with long tables that extend over several pages and have a table header on every new page?

I tried

thead {display: table-header-group;}

And on this page someone mentioned that for Flying Saucer this had to be added:

table {
-fs-table-paginate: paginate;

I tried PDF exports with both but nothing happened. When I create a PDF with the print function of the browser it works though.

2 answers

I'm guessing this is for Confluence? If so does the markup use a and elements? I remember seeing elements styled as heading rows. If they are cells then check if their surrounding has a class relating to it being a heading row as opposed to a content row. If it does then try adding display: table-header-group; to it.

Well, the heading of the table is surrounded by a <thead> element and the header cells are <th>. But when I add the "display: table-header-group" to any of these element it has no effect.

I suppose it is not working with flying saucer. But proof of the opposite would be more than welcome.

@Sean: The following sentence I do not understand. Is there a word missing perhaps?

If so does the markup use a and elements?

I will have a play when I'm at work tomorrow. Not sure if keeping the thead at the top is default browser behavior or not. Printing to PDF is probably different too.
Sorry it looks like HTML chars are removed. It was thead and td

Did anyone find an answer to this? I'm stuck trying to get repeating headers for our tables in our PDF Exports from Confluence 5.4.

Has anyone been successful at getting table headers to repeat? Thank you.

I am also still interested (but also pretty certain that it doesn't work). Just tried again with .wiki-content .table-wrap .confluenceTable thead { display: table-header-group; } .wiki-content .table-wrap table { -fs-table-paginate: paginate; }

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

2,776 views 26 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you