Defect #816
Print table header on each page
0%
Description
Not sure if this is a bug, or if I'm doing something wrong.
I've got a velocity report that has to generate a PDF file.
The report is basically a single html table, and I want the header to repeat on each page.
I think I've got the html correct but it is not working.
I've added a thead and tbody to the table and added the following to the style: thead {display: table-header-group;}
tbody{ display:table-row-group;}
I've included the report as it is generated by velocity
Files
History
Updated by Patrick Talbot almost 11 years ago
thead {display: table-header-group;}
tbody{ display:table-row-group;}
is not supported CSS.
try this instead:
table {
-fs-table-paginate: paginate;
}
Updated by Jos de Bruijn almost 11 years ago
- File report_organisation.html report_organisation.html added
That also does not repeat the header on all pages, and as a side-effect it adds a margin to all table cells
I've tried to include the generated pdf file, but this does not show up in the issue. I can mail it if you like.
Updated by Patrick Talbot almost 11 years ago
The html files are not accessible. Please zip your files (including the pdf) and attach them.
I just tried -fs-table-paginate: paginate; and yes, it nulls table-collapse: collapse (which is a known bug), but it works in my case.
You could also alternatively try a running header.
div.header { display: none } div.header { display: block; position: running(header); } @page { size: letter portrait; @top-left { content: element(header); } }
Then have a div with some repeated content. Problem is that you would have to have fixed width in your columns then.
But -fs-table-paginate: paginate; should work for thead in tables.
Updated by Patrick Talbot almost 11 years ago
Looking quickly at the template, I see you didn't define a <thead> around the <tr><th> and a <tbody> around the rest.
If you add that it should work
Updated by Patrick Talbot over 10 years ago
Does this work with thead and tbody correctly set? Please report.
Updated by Jos de Bruijn over 10 years ago
Sorry it took so long to reply.
Adding the thead and tbody does indeed repeat the header on all pages.
Now I only need to find a workaround for the margins around the cells.