HTML and CSS Reference
In-Depth Information
Note that the set of tags in the first table row are
<th>
tags, and the set in the next row (and any succeeding
row) are
<td>
tags. Browsers typically render table
header content as bold and centered, as shown in
Figure 16-2.
defining a Table Header, body, and
Footer
HTML includes a series of tags that allow for a more
structured table with separately identified header, body,
and footer regions. The
<thead>
,
<tbody>
, and
<tfoot>
tags work with the basic table tags already discussed.
Here's a more extensive example:
<table>
<thead>
<tr>
<th>Region</th>
<th>Sales</th>
<th>Amount</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Total</th>
<th> </th>
<th>$6,500</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>North</td>
<td>Peterson</td>
<td></td>
</tr>
<tr>
<td>Kim</td>
<td>Kattrell</td>
<td>x396</td>
</tr>
</tbody>
</table>
FiGure 16-2
You'll notice that the
<tfoot>
tag appears before
the
<tbody>
. This is done to allow the browser to
render properly, as shown in Figure 16-3. It's impor-
tant to understand that these three tags —
<thead>
,
<tbody>
, and
<tfoot>
— all work in tandem and, if
you use one, you should use all three.
FiGure 16-3