W3C home > Mailing lists > Public > www-html@w3.org > January 2000

RE: printing html

From: Chris Wilson <cwilso@MICROSOFT.com>
Date: Fri, 28 Jan 2000 12:22:34 -0800
Message-ID: <C35556591D34D111BB5600805F1961B91D5CDE2E@RED-MSG-47>
To: "'ben van't ende'" <argument@telekabel.nl>, www-html@w3.org
ben van't ende [mailto:argument@telekabel.nl] wrote:
>...For every page
>that is printed i'd like to have a header containing several
>items like article number etc. and a footer containing date
>etc. I tried using THEAD-TBODY-TFOOT, but in some way this
>doesn't seem to work. i'm probably overlooking something.

Using Internet Explorer 5.0+, you can do this, but it requires CSS.  Set up
your page as you describe above, using THEAD and TFOOT to contain table
header and footer information.  Now, on the THEAD element, put the CSS
stylesheet property setting "display: table-header-group" and on the TFOOT
element put the CSS stylesheet property setting "display:
table-footer-group" (you can set this through an inline style or a
stylesheet), like this:

<TABLE>
<THEAD STYLE="display: table-header-group">
<TR>
<TD>This header will display on every printed page</TD>
</TR>
</THEAD>
<TBODY>
<TR>
<TD>This is where the data rows go...</TD>
</TR>
</TBODY>
<TFOOT STYLE="display: table-footer-group">
<TR>
<TD>This footer will display on every printed page</TD>
</TR>
</TFOOT>
</TABLE>

This stylesheet setting was necessary because we'd already implemented
support for THEAD and TFOOT sections, and some customers became distraught
in one of our betas that their printouts suddenly "looked weird".

You can, of course, put two rules like
	THEAD { display: table-header-group }
	TFOOT { display: table-footer-group }
into your user stylesheet to always get this behavior on your own machine.

-Chris Wilson
Received on Friday, 28 January 2000 15:24:49 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:41 GMT