It is used to define the set of rows that make up the body of a table.
It has no attributes other than global ones, so to define presentation aspects, CSS properties such as
vertical-align will be used.
Must appear after the
Browsers can use
<tfoot> to allow scrolling of the body of the table independently of the header and footer. Similarly, when doing CSS for printing and if the table is spread across multiple pages, these elements can allow both the header and footer to appear repeated at the beginning and end of each printed page.
<tfoot> together also serve to provide useful semantic information used when rendering for screen or printer, as well as to improve accessibility.
Two rules of use:
- If the table includes a
<tbody>must come after.
- If you use
<tbody>you cannot have
<tr>that are direct children of
<table>but not included within
<tbody>. All rows that are not header or footer must go inside
<tbody>if it exists.
Multiple sections can be created within a table using multiple
<tbody> elements. Each of them can have its own header row(s), but there can only be a single
<thead> element per table. Thus, the headers for each
<tbody> will be created using
<th> with the corresponding
Has an implicit ARIA role
- Type: table-row-group
- Self-closing: No
- Semantic value: No
Top comments (0)