HTML and CSS Reference
In-Depth Information
<th> Class </th>
<th> Room </th>
<th> Time </th>
</tr>
</thead>
The <tfoot>...</tfoot> element defines the footer of the table. The starting <tfoot>
tag is always required when defining the footer of a table. The closing <tfoot> tag was
optional in HTML 4.01, but it's required for XHTML 1.0 compliance. The footer of the
table appears immediately after the table heading if one is present or after the <table>
element if a table heading isn't present. It must contain at least one row group, defined
by the <tr> element. A good example of information that you could place in a table
footer is a row that totals columns of numbers in a table.
You must define the footer of the table before the table body because the browser has to
render the footer before it receives all the data in the table body. For the purposes of this
example, we'll include the same information in the table head and the table footer. The
code looks like this:
10
Input
<tfoot style=“color: blue”>
<tr>
<th> Class </th>
<th> Room </th>
<th> Time </th>
</tr>
</tfoot>
After you define the heading and footer for the table, you define the rows in the table
body. A table can contain more than one body element, and each body can contain one or
more rows of data. This might not seem to make sense, but using multiple body sections
enables you to divide up your table into logical sections. I show you one example of why
this is rather cool in a little bit.
The <tbody>...</tbody> element defines a body section within your table. The <tbody>
start tag is required if at least one of the following is true:
The table contains head or foot sections.
n
The table contains more than one table body.
n
The following example contains two table bodies, each consisting of three rows of three
cells each. The body appears after the table footer, as follows:
 
Search WWH ::




Custom Search