I use the ff. html code to make a header always come out on top and a footer on the bottom of the page when the browser prints pages.

This time however, i need to make the column headings of a table be the header for each page, while the body will be the data of the table.

The problem is in this setup the table for the column heading will be different from that of the data. So the margins will be different since html adjusts the width of columns based on the length of the longest lines.

Is there a way to adjust the with of the columns for the table holding the column headings to match that of whatever the column widths of the data table?

or is there a better way to do this in css or html?

Thanks.

HTML code:
======================

<table border=0 align="center" width="100%">

<thead>
<tr>
<th width=100%>

<table>
<td>THIS IS THE header</td>
</table>

</thead>
</tr>


<tfoot>

<tr>
<td width=100%>

THIS IS THE footer

</tfoot>


<tbody>
<tr>

<td width="100%">
THIS IS THE BODY WHERE EVERYTHING ELSE GOES <br><br><br><br><br><br>
THIS IS THE BODY WHERE EVERYTHING ELSE GOES <br><br><br><br><br><br>
THIS IS THE BODY WHERE EVERYTHING ELSE GOES <br><br><br><br><br><br>
THIS IS THE BODY WHERE EVERYTHING ELSE GOES <br><br><br><br><br><br>
THIS IS THE BODY WHERE EVERYTHING ELSE GOES <br><br><br><br><br><br>
THIS IS THE BODY WHERE EVERYTHING ELSE GOES <br><br><br><br><br><br>
THIS IS THE BODY WHERE EVERYTHING ELSE GOES <br><br><br><br><br><br>
THIS IS THE BODY WHERE EVERYTHING ELSE GOES <br><br><br><br><br><br>
</td>

</tr>
</tbody>

</table>