<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:
Weekday | Date | Manager | Qty |
Mon | 09/11 | Kelsey | 639 |
Tue | 09/12 | Lindsey | 596 |
Wed | 09/13 | Randy | 1135 |
Thu | 09/14 | Susan | 1002 |
Fri | 09/15 | Randy | 908 |
Sat | 09/16 | Lindsey | 371 |
Sun | 09/17 | Susan | 272 |
Total | 4923 |
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/2000</TD> <TD>Kelsey</TD> </TR>
<TR> <TD>Tuesday</TD> <TD>09/12/2000</TD> <TD>Lindsey</TD> </TR>
<TR> <TD>Wednesday</TD> <TD>09/13/2000</TD> <TD>Randy</TD> </TR>
<TR> <TD>Thursday</TD> <TD>09/14/2000</TD> <TD>Susan</TD> </TR>
<TR> <TD>Friday</TD> <TD>09/15/2000</TD> <TD>Randy</TD> </TR>
<TR> <TD>Saturday</TD> <TD>09/16/2000</TD> <TD>Lindsey</TD> </TR>
<TR> <TD>Sunday</TD> <TD>09/17/2000</TD> <TD>Susan</TD> </TR>
</TBODY>
<TBODY>
<TR> <TD>Monday</TD> <TD>09/18/2000</TD> <TD>Melody</TD> </TR>
<TR> <TD>Tuesday</TD> <TD>09/19/2000</TD> <TD>Christiane</TD> </TR>
<TR> <TD>Wednesday</TD> <TD>09/20/2000</TD> <TD>Symphony</TD> </TR>
<TR> <TD>Thursday</TD> <TD>09/21/2000</TD> <TD>Starflower</TD> </TR>
<TR> <TD>Friday</TD> <TD>09/22/2000</TD> <TD>Miko</TD> </TR>
<TR> <TD>Saturday</TD> <TD>09/23/2000</TD> <TD>Cleo</TD> </TR>
<TR> <TD>Sunday</TD> <TD>09/24/2000</TD> <TD>Alyx</TD> </TR>
</TBODY>
<TBODY>
<TR> <TD>Monday</TD> <TD>09/25/2000</TD> <TD>Dancing Star</TD> </TR>
<TR> <TD>Tuesday</TD> <TD>09/26/2000</TD> <TD>Dawn</TD> </TR>
<TR> <TD>Wednesday</TD> <TD>09/27/2000</TD> <TD>Josh</TD> </TR>
<TR> <TD>Thursday</TD> <TD>09/28/2000</TD> <TD>Ryan</TD> </TR>
<TR> <TD>Friday</TD> <TD>09/29/2000</TD> <TD>Mary Kay</TD> </TR>
<TR> <TD>Saturday</TD> <TD>09/30/2000</TD> <TD>Hallie</TD> </TR>
<TR> <TD>Sunday</TD> <TD>10/01/2000</TD> <TD>Paul</TD> </TR>
</TBODY>
</TABLE>
which gives us this table:
Weekday | Date | Manager |
Monday | 09/11/2000 | Kelsey |
Tuesday | 09/12/2000 | Lindsey |
Wednesday | 09/13/2000 | Randy |
Thursday | 09/14/2000 | Susan |
Friday | 09/15/2000 | Randy |
Saturday | 09/16/2000 | Lindsey |
Sunday | 09/17/2000 | Susan |
Monday | 09/18/2000 | Melody |
Tuesday | 09/19/2000 | Christiane |
Wednesday | 09/20/2000 | Symphony |
Thursday | 09/21/2000 | Starflower |
Friday | 09/22/2000 | Miko |
Saturday | 09/23/2000 | Cleo |
Sunday | 09/24/2000 | Alyx |
Monday | 09/25/2000 | Dancing Star |
Tuesday | 09/26/2000 | Dawn |
Wednesday | 09/27/2000 | Josh |
Thursday | 09/28/2000 | Ryan |
Friday | 09/29/2000 | Mary Kay |
Saturday | 09/30/2000 | Hallie |
Sunday | 10/01/2000 | Paul |