Forum Moderators: open
This would be a great feature, but I cannot seem to get it to work in IE6. Does anyone know if it is supported? The only thing I can think of is that I haven't set the doctype correctly. The code I'm using is below.
Can anyone help? Thanks,
Ceri
-------------------------------------
<table border = "1">
<thead>
<tr>
<td>This text is in the THEAD</td>
</tr>
</thead>
<tfoot>
<tr>
<td>This text is in the TFOOT</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>This text is in the TBODY</td>
</tr>
<tr>
<td>This text is in the TBODY</td>
</tr>
.
.
.
</tbody>
</table>
------------------------------------
[edited by: tedster at 5:40 pm (utc) on Jan. 22, 2004]
I do this by counting the number of rows returned and just plain guessing where to drop the headers.
Remember, people will set their page setup margins differently and will have different resolution screens. Font size will also affect the outcome.
If you are good with CSS you could make your body part of the table scrollable so the headers will always stay visible. But that won't help with printing.
Again, you'll have to guess where the page braks will occur, picking a paper size and page orientation to optimize for (i.e., letter size paper with portrait orientation). Setting your font-size to absolute point size in your print style sheet might be a good idea as well.
Of course, user-set properties such as page margins can always cause variances that will affect the amount of text printed to each page.
In CSS3 there is a mechanism defined for the placement of running page headers and footers. An example given in the documentation is:
<style>
@page {
@top-left{
font-family: Helvetica, Arial, sans-serif;
font-size: 18pt150%;
font-weight: bolder;
text-align: left;
content: "XHTML-Print: A Proposal --- August 25, 2000";
}
}
</style>
[w3.org...]
Unfortunately, this doesn't help you much with your current problem.
In the end, if I had a page with tabular data that I thought my users would frequently print out, I'd create a PDF version of the page to ensure a consistent priint layout that had column headers at the top of each page.