Forum Moderators: open

Message Too Old, No Replies

Adding header and footer on long printed page

How can I do it?

         

Paco

3:49 pm on Oct 28, 2003 (gmt 0)

10+ Year Member



I've got a long html page that I want to print with a header and a footer that should appear on every printed page. Any clues?

Alternative Future

4:08 pm on Oct 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Paco,

These two threads should help you out:

1. [webmasterworld.com...]
2. [webmasterworld.com...]

hth,

-gs

Paco

4:42 pm on Oct 28, 2003 (gmt 0)

10+ Year Member



Alternative_future:

thanks a lot, that second link did it. I had missed the thead and tfoot display: table-footer(/header)-group styles.

Here's the solution to my problem:

I put the following 2 lines in the style sheet definition:

thead { display: table-header-group; }
tfoot { display: table-footer-group; }

Then I put the whole page inside a large table:

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

<thead>
<tr>
<th width=100%>THIS IS THE HEADER
</thead>

<tfoot>
<tr>
<td width=100%>THIS IS THE FOOTER
</tfoot>

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

</table>

Put what you want to show up as the header and footer for each page, as everytime this table "wraps" to a new page, the header and footer are redisplayed!

It works :)

Just a note: it looks like I don't finish the <TD> tags within the THEAD and TFOOT elements, but it works!

Thanks for your help too guys.