问题
I'm working in a J2EE environment with a web app that displays large amounts of tabular data. We want to be able to print these tables with each page displaying the header and footer. I understand some browsers support this through the thead,tbody,tfooter tags, but the users are using IE6 only. A row is normally only one line but on occasion can be two or three (maybe more).
What are my options here? Is there a quick and easy way that I'm not aware of? Do I need to some how "calculate" the height of a set of rows? Or am I stuck doing something static that will hopefully work "most of the time?"
Thanks for any help.
回答1:
You're doing the right thing in THEAD
and TBODY
tags, but try adding the following CSS definitions too:
thead {
display: table-header-group;
}
tbody {
display: table-row-group;
}
来源:https://stackoverflow.com/questions/518163/printer-friendly-pages-with-a-header-on-every-page