HTML and CSS Reference
In-Depth Information
brain ache when you come back to your markup a few months down the line and wonder
what on earth you were thinking.
The
tfoot
element, however,
must
come before the
tbody
element. Why does the
footer come before the body? It's so that a user agent can render the top and bottom of
the table before starting on the middle, which is useful if you plan to have your table
body scroll and you have many rows.
Finally, you add the
tbody
element. This tag is actually implicit in your table re-
gardless. For example, try adding
tbody {font-style: italic}
to your CSS
and apply it to a basic table, and you'll see that it styles the text in your table in an it-
alic font. Even though its existence is implied, you
must
explicitly include the
tbody
tag if you're using
thead
and
tfoot
. So, once these elements are added, your markup
should look a little like this:
<table>
<thead>
<tr>
<th>Name</th>
<th>Place of residence</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Place of residence</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>Anselm Bradford</td>
<td>Auckland</td>
</tr>
<tr>
<td>Paul Haine</td>
<td>Oxford</td>
</tr>
</tbody>
</table>
Search WWH ::
Custom Search