[Techtalk] Re: (HTML) Repeating TH elements

Ricky Buchanan rb at tertius.net.au
Mon Jan 12 05:22:34 EST 2004


dominik.schramm at gmxpro.net wrote:
> I've also looked for the answer, but found nothing.
> I don't know the answer, I'm just speculating below, but
> you may be lucky to get an answer in a forum/newsgroup...
> specialized in HTML.

I figured it out!

And BTW there *is* the concept of a "page" in HTML if you are using HTML
in a "paginated" media (eg printed out).

The way to do it is this:

<TABLE WIDTH="100%" BORDER="1">
   <THEAD>
      <TR VALIGN="top">
         <TH>M</TH>
         <TH>T</TH>
         <TH>W</TH>
         <TH>T</TH>
         <TH>F</TH>
         <TH>S</TH>
         <TH>S</TH>
      </TR>
   </THEAD>
   <TBODY>
      <TR>
         <TD>X</TD>
         <TD></TD>
         <TD>X</TD>
         <TD></TD>
         <TD>X</TD>
         <TD></TD>
         <TD></TD>
      </TR>
      ... etc etc lots of rows .... .... ...
      <TR>
         <TD>X</TD>
         <TD></TD>
         <TD>X</TD>
         <TD></TD>
         <TD>X</TD>
         <TD></TD>
         <TD></TD>
      </TR>
   </TBODY>
</TABLE>

Everything inside the <THEAD> gets repeated at the top of each page,
when using a paginated @media format (eg printing), plus at the top of
the table in all media (ie on screen it comes at the top of the table
only.  on paper it is at the top of the table PLUS the  top of each page
the table is broken at).


And just because I discovered it, there's a corresponding <TFOOT>
element which comes at the BOTTOM of the table plus the BOTTOM of each
page the table breaks at if using paginated media.

Nifty, innit!


www.w3.org rocks my world :)



Regards,
Ricky
Feeling extremely proud because it WAS a hard problem and it took AGES
to solve.

-- 
: Usual state:  (e) None of the above.
: rb at tertius.net.au       http://tertius.net.au/~rb/
: How do you go from where you are to where you want to be? I
: think you have to have an enthusiasm for life.  You have to have
: a dream, a goal, and you have to be willing to work for it.
: -- Jim Valvano


More information about the Techtalk mailing list