HTML <tfoot> Tag

Beginner
6 min read
Updated: Nov 2026
4 examples
Live preview

Definition and Usage

The <tfoot> element groups the footer rows of a <table>. Those rows are usually a summary of the columns — totals, averages, or short notes. Each row is a <tr> with <th> or <td> cells.

Pair it with <thead> and <tbody> for a clear head / body / foot structure. A table may have only one <tfoot>. Place it after caption, colgroup, thead, and tbody; browsers still show it at the bottom.

Baseline · Widely available.

Not deprecated. Core tfoot support has been stable across browsers since about July 2015 (and much earlier in practice).

Deprecated attributes.

Do not use align, bgcolor, char, charoff, or valign on <tfoot>. Prefer CSS text-align, background-color, and vertical-align.

HTML4 vs modern order.

Older HTML4 put tfoot before tbody. In modern HTML, put tfoot after the body. Prefer the modern order.

HTML Syntax

syntax.html
<tfoot> tr rows</tfoot>

The start tag is required. The end tag may be omitted if nothing follows in the parent <table>, but writing both tags is clearer. Content is zero or more <tr> rows.

Attributes

Modern <tfoot> has no current element-specific attributes — only global attributes. These older attributes are deprecated (shown for migration):

AttributeDescriptionTry it
alignDeprecated — use CSS text-align insteadTry it
bgcolorDeprecated — use CSS background-color insteadTry it
valignDeprecated — use CSS vertical-align insteadTry it
char / charoffDeprecated — use CSS text-align (and tabular numerals) insteadTry it

On cells inside the footer, you will often use colspan and scope (on <th>).

Global Attributes

The <tfoot> tag also supports the Global Attributes in HTML.

Live Preview

Switch the footer summary on a real table that already has thead and tbody.

A real <tfoot>. Only one footer group is allowed per table.

Table
Team expenses
ItemCost
Snacks40
Travel120
Total160

Footer shows a total of 160

HTML Examples

Short, copy-ready snippets. Use Try It Yourself for a live editor.

Example 1 — Basic Total Row

Put a summary row in <tfoot> under the main data.

HTML
<table>
  <thead>
    <tr>
      <th scope="col">Item</th>
      <th scope="col">Cost</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">Snacks</th>
      <td>40</td>
    </tr>
    <tr>
      <th scope="row">Travel</th>
      <td>120</td>
    </tr>
  </tbody>
  <tfoot>
    <tr>
      <th scope="row">Total</th>
      <td>160</td>
    </tr>
  </tfoot>
</table>
Try It Yourself

How It Works

  1. thead holds column labels.
  2. tbody holds each expense row.
  3. tfoot holds the total that summarizes the Cost column.
  4. scope="row" on the Total header marks it as the label for that footer row.

Example 2 — colspan in the Footer

Span a footer label across several columns, then place the summary value in the last cell.

HTML
<table>
  <thead>
    <tr>
      <th scope="col">ID</th>
      <th scope="col">Name</th>
      <th scope="col">Major</th>
      <th scope="col">Credits</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>101</td>
      <td>Ada</td>
      <td>CS</td>
      <td>240</td>
    </tr>
    <tr>
      <td>202</td>
      <td>Marie</td>
      <td>Physics</td>
      <td>260</td>
    </tr>
  </tbody>
  <tfoot>
    <tr>
      <th colspan="3" scope="row">Average credits</th>
      <td>250</td>
    </tr>
  </tfoot>
</table>
Try It Yourself

How It Works

  1. Count columns in the header (here: 4).
  2. Set colspan="3" on the footer label so it covers ID, Name, and Major.
  3. Leave one <td> for the average under Credits.
  4. Check the math: 3 + 1 = 4 columns.

Example 3 — Caption with Full Sections

Name the table, then use thead, tbody, and tfoot together.

HTML
<table>
  <caption>Council budget</caption>
  <thead>
    <tr>
      <th scope="col">Item</th>
      <th scope="col">Cost</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">Stationery</th>
      <td>18,000</td>
    </tr>
    <tr>
      <th scope="row">Snacks</th>
      <td>3,000</td>
    </tr>
  </tbody>
  <tfoot>
    <tr>
      <th scope="row">Totals</th>
      <td>21,000</td>
    </tr>
  </tfoot>
</table>
Try It Yourself

How It Works

  1. caption names the table for everyone, including assistive tech.
  2. Order in HTML: caption → thead → tbody → tfoot.
  3. Semantics stay clear for screen readers and for print (footers can repeat as summaries).
  4. Style tfoot separately from tbody when you want totals to stand out.

Example 4 — Footer Note Row

A footer can hold a short note, not only a numeric total.

HTML
<table>
  <thead>
    <tr>
      <th scope="col">Day</th>
      <th scope="col">Hours</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Mon</td>
      <td>6</td>
    </tr>
    <tr>
      <td>Tue</td>
      <td>5</td>
    </tr>
  </tbody>
  <tfoot>
    <tr>
      <td colspan="2">Hours are estimates for planning only.</td>
    </tr>
  </tfoot>
</table>
Try It Yourself

How It Works

  1. Keep data in tbody and put the explanation in tfoot.
  2. Use colspan when the note should span the full width.
  3. One tfoot only — put extra notes in the same footer group if needed.
  4. Prefer short notes; long prose usually belongs outside the table.

Edge Cases & Pitfalls

Most tfoot mistakes are order rules, duplicate footers, or presentational attributes.

limits

Only one tfoot per table

Unlike tbody, you cannot stack multiple footers. Keep all footer rows in that single group.

order

Use modern markup order

After caption/colgroup: thead, then tbody, then tfoot. Do not copy the old HTML4 “tfoot before tbody” habit.

spans

Keep column math valid

When using colspan in the footer, the spanned cells plus remaining cells must equal the table width.

attrs

Skip deprecated align / bgcolor

Style the footer with CSS. Presentational attributes on tfoot are obsolete.

purpose

Footer is not page layout

tfoot summarizes tabular data. Page footers belong in <footer> or CSS layout — not a table foot.

Browser Support

The <tfoot> element is core HTML table markup in every browser. It is not a Node.js, Deno, or Bun API.

✓ Baseline · Widely available

<tfoot>

Widely available since about July 2015 (and long before). Modern HTML places tfoot after tbody; browsers still render it at the bottom of the table.

98% Global support (approx.)
Google Chrome All
Full support
Mozilla Firefox All
Full support
Apple Safari All
Full support
Microsoft Edge All
Full support
Opera All
Full support
Samsung Internet All
Full support
Internet Explorer All
Supported
<tfoot> Widely supported

Bottom line: Safe to use for table summaries. Prefer modern order (after tbody), one tfoot only, and CSS instead of deprecated attributes.

Key Takeaways

  • Role: <tfoot> groups footer/summary rows for a table.
  • Partners: use with thead and tbody for clear sections.
  • Limit: only one tfoot per table.
  • Order: put tfoot after tbody in modern HTML.

One line: put totals or column notes in a single <tfoot> after your data rows.

Default CSS Settings

Typical user-agent styling for tfoot (simplified; exact rules vary by browser):

default.css
tfoot {
  display: table-footer-group;
  vertical-align: middle;
  border-color: inherit;
}

Style footer cells with selectors like tfoot th and tfoot td. The group still appears at the bottom even when written after tbody.

Frequently Asked Questions

The tfoot element groups footer rows of a table — usually totals, averages, or notes about the columns. It works with thead and tbody to mark clear table sections.
No. Use it when you need a summary or footer row group. Simple tables can use only table, tr, th, and td.
No. A table may have only one tfoot (and only one thead). You can have multiple consecutive tbody sections.
Inside table, after any caption, colgroup, thead, and tbody. Browsers still render the footer at the bottom of the table.
Yes. Older HTML4 required tfoot before tbody. In modern HTML, place tfoot after the body rows. Prefer the modern order.
No. Those attributes are deprecated. Style the footer with CSS such as background-color, text-align, and vertical-align.

Next: th

Learn header cells for columns and rows in a table.

th tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

12 people found this page helpful