CKTIS / HTML
tfoot — table summary row group
The tfoot element groups rows summarizing table columns, such as totals. It belongs after the table's data rows.
Version: WHATWG HTML Living Standard; index snapshot date recorded separately
Syntax
<tfoot>
<tr><th scope="row">Total</th><td>5</td></tr>
</tfoot>tfoot represents rows summarizing columns of its parent table. Unlike thead and tbody, it is for summaries rather than column headers or main data.
A table allows at most one tfoot, directly inside table, after any caption, colgroup, thead, tbody, and direct tr elements. It contains zero or more tr and script-supporting elements; put th and td cells inside tr.
It supports global attributes and the HTMLTableSectionElement DOM interface. In text/html, its start tag is required; its end tag is omissible only when no further content remains in the parent.
Examples
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Table total</title>
</head>
<body>
<table>
<caption>Item counts</caption>
<thead>
<tr><th scope="col">Item</th><th scope="col">Count</th></tr>
</thead>
<tbody>
<tr><th scope="row">A</th><td>2</td></tr>
<tr><th scope="row">B</th><td>3</td></tr>
</tbody>
<tfoot>
<tr><th scope="row">Total</th><td>5</td></tr>
</tfoot>
</table>
</body>
</html>Result
The browser renders a table captioned “Item counts” with columns “Item” and “Count”. The body rows show A with 2 and B with 3, and the footer row shows “Total” with 5. The browser’s table layout aligns the columns.
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.