CKTIS / HTML
tfoot — groep met samenvattingsrijen van een tabel
Het element tfoot groepeert rijen die tabelkolommen samenvatten, bijvoorbeeld totalen. Het staat na de gegevensrijen van de tabel.
Versie: WHATWG HTML Living Standard; index snapshot date recorded separately
Syntax
<tfoot>
<tr><th scope="row">Total</th><td>5</td></tr>
</tfoot>tfoot staat voor rijen die kolommen van de bovenliggende table samenvatten. In tegenstelling tot thead en tbody is het bedoeld voor samenvattingen, niet voor kolomkoppen of de hoofdgegevens.
Een tabel mag maximaal één tfoot bevatten. Dit staat direct in table, na eventuele elementen caption, colgroup, thead, tbody en directe tr-elementen. Het bevat nul of meer tr-elementen en elementen voor scriptondersteuning; th- en td-cellen staan binnen tr.
Het ondersteunt globale attributen en de DOM-interface HTMLTableSectionElement. In text/html is de starttag verplicht. De eindtag mag alleen worden weggelaten als er geen verdere inhoud in het bovenliggende element staat.
Voorbeelden
<!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>Resultaat
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.
De getoonde code en het opgegeven resultaat zijn in een geïsoleerde omgeving geverifieerd met de methode die in het verificatiebewijs voor exact deze versie is vastgelegd.