Tables are useful for showing data. They make defining rows and columns very easy. In the past, tables were used to create layouts, but today, that is done with CSS. They should be used to only display the tabular data.
The
tfoot
element is the table footer element:
<tfoot></tfoot>
The tfoot
element is the footer for the table. It must be used after any thead
elements, but can be either before or after tbody
. The placement of the tfoot
element does not affect where it is rendered, which is always at the bottom.
Here is an example:
<table> <tbody> <tr> <td>Column in Row 1</td> </tr> </tbody> <tfoot> <tr> <td>Footer 1</td> </tr> </tfoot> </table>
The tr
element is the table row element:
<tr></tr>
The tr
element is the row element. Every time you need another row in a table, use this element. This element can be the child of a table
, tbody
, thead
, or tfoot
element. You must use either a td
or th
as its child.
Here is an example:
<table> <tbody> <tr> <td>Column in Row 1</td> </tr> </tbody> </table>
The td
element is the table cell element:
<td colspan headers rowspan></td>
The th
element is the table header cell element:
<th colspan rowspan></th>