HTML and CSS Reference
In-Depth Information
Marking Row Groups
You can combine sections of rows into row groups in which each row group represents
a different collection of table data or information. HTML supports three row groups: one
to mark the header rows, another for the body rows, and a third for the footer rows. The
syntax to create these three row groups is
<table>
<thead>
table rows
</thead>
<tfoot>
table rows
</tfoot>
<tbody>
table rows
</tbody>
</table>
where table rows are rows from the Web table. For example, the following code marks
two rows as belonging to the table header row group:
<thead>
<tr>
<th colspan=”2”>KPAF Programs</th>
</tr>
<tr>
<th>Time</th>
<th>Program</th>
</tr>
</thead>
Order is important. The thead element must appear fi rst, and then the tfoot element,
and fi nally the tbody element. A table can contain only one thead element and one
tfoot element, but it can include any number of tbody elements. The reason the table
body group appears last, rather than the footer group, is to allow the browser to render
the footer before receiving what might be numerous groups of table body rows.
One purpose of row groups is to allow you to create different styles for groups of rows
in your table. Any style that you apply to the thead , tbody , or tfoot element is inher-
ited by the rows those elements contain. Row groups also are used for tables in which
table body contents are made up of imported data from external data sources such as
databases or XML documents. In those situations, a single table can span several Web
pages, with different imported content displayed in the table body in each page but the
same table header and table footer bracketing each page of content.
The table header, table
body, and table footer all
must contain the same
number of columns.
Search WWH ::




Custom Search