HTML <THEAD ...>, <TBODY ...> , <TFOOT ...>

<THEAD ...>, <TBODY ...>, and <TFOOT ...> establish groups of rows. <THEAD ...> indicates that a group of rows are the header rows at the top of the table. <TBODY ...> indicates that a group of rows are body rows. <TFOOT ...> indicates that a group of rows are the footer rows at the bottom of the table.

The most popuplar use for these three tags, which are currently only recognized by MSIE 4 and up, is to put borders between groups of rows instead of between every row. For example, suppose you have a table in which you want borders around the top row, the bottow row, and around the entire block of rows in between. You could do that with the following code. Note that in addition to <THEAD ...>, <TBODY ...>, and <TFOOT ...> you also must use <TABLE RULES=GROUPS>:

<TABLE CELLPADDING=6 RULES=GROUPS FRAME=BOX>

<THEAD>
<TR> <TH>Weekday</TH> <TH>Date</TH> <TH>Manager</TH> <TH>Qty</TH> </TR>
</THEAD>
<TBODY>
<TR> <TD>Mon</TD> <TD>09/11</TD> <TD>Kelsey</TD> <TD>639</TD> </TR>
<TR> <TD>Tue</TD> <TD>09/12</TD> <TD>Lindsey</TD> <TD>596</TD> </TR>
<TR> <TD>Wed</TD> <TD>09/13</TD> <TD>Randy</TD> <TD>1135</TD> </TR>
<TR> <TD>Thu</TD> <TD>09/14</TD> <TD>Susan</TD> <TD>1002</TD> </TR>
<TR> <TD>Fri</TD> <TD>09/15</TD> <TD>Randy</TD> <TD>908</TD> </TR>
<TR> <TD>Sat</TD> <TD>09/16</TD> <TD>Lindsey</TD> <TD>371</TD> </TR>
<TR> <TD>Sun</TD> <TD>09/17</TD> <TD>Susan</TD> <TD>272</TD> </TR>
</TBODY>
<TFOOT>
<TR> <TH ALIGN=LEFT COLSPAN=3>Total</TH> <TH>4923</TH> </TR>
</TFOOT>

</TABLE>

which gives us this table:

WeekdayDateManagerQty
Mon09/11Kelsey639
Tue09/12Lindsey596
Wed09/13Randy1135
Thu09/14Susan1002
Fri09/15Randy908
Sat09/16Lindsey371
Sun09/17Susan272
Total4923

You should use at most one <THEAD ...> or <TFOOT ...>, but you can use multiple <TBODY ...>'s. For example, the following code has several <TBODY ...>'s to create multiple groups of data:

<TABLE RULES=GROUPS FRAME=BOX>

<THEAD>
<TR> <TH>Weekday</TH> <TH>Date</TH> <TH>Manager</TH> </TR>
</THEAD>
<TBODY>
<TR> <TD>Monday</TD> <TD>09/11/2002</TD> <TD>Kelsey</TD> </TR>
<TR> <TD>Tuesday</TD> <TD>09/12/2002</TD> <TD>Lindsey</TD> </TR>
<TR> <TD>Wednesday</TD> <TD>09/13/2002</TD> <TD>Randy</TD> </TR>
<TR> <TD>Thursday</TD> <TD>09/14/2002</TD> <TD>Susan</TD> </TR>
<TR> <TD>Friday</TD> <TD>09/15/2002</TD> <TD>Randy</TD> </TR>
<TR> <TD>Saturday</TD> <TD>09/16/2002</TD> <TD>Lindsey</TD> </TR>
<TR> <TD>Sunday</TD> <TD>09/17/2002</TD> <TD>Susan</TD> </TR>
</TBODY>
<TBODY>
<TR> <TD>Monday</TD> <TD>09/18/2002</TD> <TD>Melody</TD> </TR>
<TR> <TD>Tuesday</TD> <TD>09/19/2002</TD> <TD>Christiane</TD> </TR>
<TR> <TD>Wednesday</TD> <TD>09/20/2002</TD> <TD>Symphony</TD> </TR>
<TR> <TD>Thursday</TD> <TD>09/21/2002</TD> <TD>Starflower</TD> </TR>
<TR> <TD>Friday</TD> <TD>09/22/2002</TD> <TD>Miko</TD> </TR>
<TR> <TD>Saturday</TD> <TD>09/23/2002</TD> <TD>Cleo</TD> </TR>
<TR> <TD>Sunday</TD> <TD>09/24/2002</TD> <TD>Alyx</TD> </TR>
</TBODY>
<TBODY>
<TR> <TD>Monday</TD> <TD>09/25/2002</TD> <TD>Dancing Star</TD> </TR>
<TR> <TD>Tuesday</TD> <TD>09/26/2002</TD> <TD>Dawn</TD> </TR>
<TR> <TD>Wednesday</TD> <TD>09/27/2002</TD> <TD>Josh</TD> </TR>
<TR> <TD>Thursday</TD> <TD>09/28/2002</TD> <TD>Ryan</TD> </TR>
<TR> <TD>Friday</TD> <TD>09/29/2002</TD> <TD>Mary Kay</TD> </TR>
<TR> <TD>Saturday</TD> <TD>09/30/2002</TD> <TD>Hallie</TD> </TR>
<TR> <TD>Sunday</TD> <TD>10/01/2002</TD> <TD>Paul</TD> </TR>
</TBODY>
</TABLE>

which gives us this table:

WeekdayDateManager
Monday09/11/2002Kelsey
Tuesday09/12/2002Lindsey
Wednesday09/13/2002Randy
Thursday09/14/2002Susan
Friday09/15/2002Randy
Saturday09/16/2002Lindsey
Sunday09/17/2002Susan
Monday09/18/2002Melody
Tuesday09/19/2002Christiane
Wednesday09/20/2002Symphony
Thursday09/21/2002Starflower
Friday09/22/2002Miko
Saturday09/23/2002Cleo
Sunday09/24/2002Alyx
Monday09/25/2002Dancing Star
Tuesday09/26/2002Dawn
Wednesday09/27/2002Josh
Thursday09/28/2002Ryan
Friday09/29/2002Mary Kay
Saturday09/30/2002Hallie
Sunday10/01/2002Paul

< back to Tables