👀 Live Preview
Table with thead, tbody data, and a tfoot total row:
| Product | Units | Revenue |
|---|---|---|
| Widget A | 100 | $1,000 |
| Widget B | 50 | $500 |
| Total Sales: | $1,500 | |

The <tfoot> tag groups footer rows in a table for totals, summaries, and metadata. This guide covers syntax, thead/tbody/tfoot structure, colspan, CSS styling, accessibility, and best practices for beginners.
Summary row group.
Grand totals & sums.
Span label cells.
Inside table element.
thead, tbody, tfoot.
Semantic structure.
<tfoot> Tag?The <tfoot> tag is an HTML element used inside <table> to define the footer section of a table. It groups rows that summarize or provide context for the data in tbody, such as totals, subtotals, or copyright notes.
tfoot wraps one or more tr elements with td or th cells. Pair it with thead and tbody for a complete semantic table.
Footer rows visually appear at the bottom of the table even when you write tfoot before tbody in HTML5. For readability, many developers still place tfoot after tbody in source order.
Place tfoot inside table with tr rows containing summary cells:
<table>
<thead>
<!-- Table header rows -->
</thead>
<tbody>
<!-- Main data rows -->
</tbody>
<tfoot>
<!-- Footer / summary rows -->
</tfoot>
</table><tfoot>
<tr>
<td colspan="2">Total Sales:</td>
<td>$1,000,000</td>
</tr>
</tfoot>tfoot must be a direct child of table (along with caption, colgroup, thead, and tbody).tr elements go directly inside tfoot.colspan on footer cells to span label text across columns.th in footer rows for summary labels like “Subtotal” or “Total”.tfoot element.| Topic | Code Snippet | Notes |
|---|---|---|
| Basic tfoot | <tfoot>...</tfoot> | Footer row group |
| Total row | colspan="2" + value | Span labels |
| Footer label | <th>Subtotal</th> | Summary header cell |
| Metadata | colspan="3" copyright | Full-width note |
| vs tbody | tfoot = summary | tbody = data |
| Browser support | Universal | All browsers |
<thead>, <tbody>, and <tfoot>| Element | Contains | Typical cells |
|---|---|---|
<thead> | Header rows | th column labels |
<tbody> | Main data rows | td data values |
<tfoot> | Footer / summary rows | Totals, metadata |
| Source order | thead → tbody → tfoot | Recommended for clarity |
The <tfoot> tag has no tag-specific attributes. Use global attributes and colspan on child cells for layout.
<tfoot class="table-footer">
<tr>
<td colspan="2">Total:</td>
<td>$100</td>
</tr>
</tfoot>class / id GlobalStyle all footer rows with a shared background or bold text.
class="table-footer"colspan On td/thSpan footer label cells across multiple columns before a total value.
colspan="2"th in tfoot SemanticUse th for summary labels like Subtotal or Total.
<th>Total</th>align / valign ObsoleteDeprecated presentational attributes. Use CSS on footer cells instead.
text-align: rightTable summaries, metadata footers, and subtotal rows with copy-ready code and live previews.
Table with thead, tbody data, and a tfoot total row:
| Product | Units | Revenue |
|---|---|---|
| Widget A | 100 | $1,000 |
| Widget B | 50 | $500 |
| Total Sales: | $1,500 | |
Use <tfoot> to summarize table data, display totals, and add metadata at the bottom of structured tables.
The tfoot tag is commonly used to show totals or other summary information about the data above:
<table>
<thead>
<tr>
<th>Product</th>
<th>Units Sold</th>
<th>Revenue</th>
</tr>
</thead>
<tbody>
<tr>
<td>Product A</td>
<td>500</td>
<td>$500,000</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="2">Total Sales:</td>
<td>$1,000,000</td>
</tr>
</tfoot>
</table>Include copyright or source notes in the table footer spanning all columns:
<tfoot>
<tr>
<td colspan="3">© 2026 Your Company Name. All rights reserved.</td>
</tr>
</tfoot>Use th cells in tfoot for summary labels like subtotals:
<tfoot>
<tr>
<th colspan="2">Subtotal</th>
<td>$15.00</td>
</tr>
</tfoot>th cells for clearer semantics.thead give context to footer totals.tbody data.caption describes the whole table including its summary rows.tfoot in layout tables; it confuses assistive technologies.Summary tr rows with totals or notes go inside tfoot.
tfoot is treated as a distinct row group, rendered at the table bottom.
Classes on tfoot add bold text, borders, or background emphasis.
Totals and metadata are semantically grouped at the bottom of structured tables.
The <tfoot> tag is supported in all major browsers, including Internet Explorer.
All browsers render <tfoot> as the standard table footer row group.
Bottom line: Use <tfoot> confidently to group table footer rows in any browser.
The <tfoot> tag is essential for well-structured HTML tables. By grouping summary and footer rows separately from body data, you improve clarity, styling control, and semantic meaning in tabular content.
tfoot for totals, subtotals, and relevant summariescolspan to align label cells with data columnstfoot with CSS for visual separation from body rowstfoot with thead and tbody for full structuretfootborder or align attributes on tablestfoot without purpose<tfoot>Bookmark these before you add footer rows to your next HTML table.
Summary rows.
PurposeGrand sums.
Use caseSpan labels.
LayoutSummary vs data.
ComparisonSemantic totals.
A11yAll browsers.
Compatibilitytfoot after tbody for clarity. HTML5 also allows tfoot before tbody; browsers still render it at the bottom.tbody holds main data rows. tfoot holds summary or footer rows such as totals and copyright notes.colspan on td or th cells is common to span label text across columns before a total value.Practice <tfoot> with totals, metadata, and colspan in the Try It editor.
6 people found this page helpful