Code has been added to clipboard!

HTML tfoot Tag

Reading time 2 min
Published Jun 29, 2017
Updated Sep 11, 2019

HTML tfoot: Main Tips

  • To group footer content of an HTML table, you should use the tfoot tag.
  • <tfoot> goes together with the <tbody> and <thead> to specify each part of table (footer, header, body).
  • <tfoot> should have one or more <tr> tags inside.

Defining HTML Table Footers

The tfoot tag is used to define the content of the HTML table footer:

Example
<table border="1">
 <thead>
   <tr>
     <th>Cats</th>
     <th>Dogs</th>
   </tr>
 </thead>
 <tbody>
   <tr>
     <td>7</td>
     <td>6</td>
   </tr></tbody>
 <tfoot align="center">
   <tr>
     <th colspan="2">Cats win!</th>
   </tr>
 </tfoot> 
</table>

One table can only have one tfoot element. It should be positioned below the <tbody> in the document flow.

It should also always appear after <thead>, <colgroup> and <caption>, if any are used.

Deprecated tfoot Tag Attributes

HTML tfoot tag had a few specific attributes. However, they all have been deprecated in HTML4 and removed completely in HTML5. We'd advise you to use CSS properties for styling instead.

align defined the alignment of content for the <tfoot>:

Example
<tfoot align="center">

Note: instead of align, use the CSS text-align property.

char defined the alignment of content for the <tfoot> element to a character:

Example
<tfoot align="char" char=".">

charoff set the number of characters the content of the <tfoot> element should be aligned from the character set by the char attribute:

Example
<tfoot align="char" char="." charoff="2">

valign set all the content of the <tfoot> element to align vertically:

Example
<tfoot valign="bottom">

Note: instead of valign, use the CSS vertical-align property.

Browser Support

Chrome
1+
Edge
All
Firefox
1+
IE
All
Opera
All
Safari
All

Mobile Browser Support

Chrome
All
Firefox
4+
Opera
All
Safari
All
Basics
Introduction
Syntax
Editors
Basic Examples
Head Section
<!DOCTYPE>
Tags and Elements
Semantic Elements
Tags Reference
Attributes
Comments
Block and Inline Elements
Forms
Form Elements
Input
Responsive Web Design
Inline Scripts
Uniform Resource Locator
Redirect
XHTML
Geolocation
Drag and Drop
Local Storage
Web Workers
Server-Sent Events
Character Encoding
Text Formatting
Quotation and Citation Elements
Headings
Paragraphs
Links
Tables
Lists
Symbols
Space
Tab
Styles
Computer Code
Layout
Classes
Colors
Images
iframes
Audio Player
Video Player
YouTube Videos
Multimedia
Canvas
SVG
<!-- -->
<a>
<abbr>
<acronym> DEPRECATED
<address>
<applet> DEPRECATED
<article>
<aside>
<audio>
<b>
<base>
<basefont> DEPRECATED
<bdi>
<bdo>
<big> DEPRECATED
<blink> DEPRECATED
<blockquote>
<body>
<br>
<button>
<canvas>
<caption>
<center> DEPRECATED
<cite>
<code>
<col>
<colgroup>
<datalist>
<dd>
<del>
<details>
<dfn>
<dialog>
<dir> DEPRECATED
<div>
<dl>
<dt>
<em>
<embed>
<fieldset>
<figcaption>
<figure>
<font> DEPRECATED
<footer>
<form>
<frame> DEPRECATED
<frameset> DEPRECATED
<h1> – <h6>
<head>
<header>
<hr>
<html>
<i>
<iframe>
<img>
<input>
<ins>
<kbd>
<keygen> DEPRECATED
<label>
<legend>
<li>
<link>
<main>
<map>
<mark>
<menu>
<menuitem> DEPRECATED
<meta>
<meter>
<nav>
<noframes> DEPRECATED
<noscript>
<object>
<ol>
<optgroup>
<option>
<output>
<p>
<param>
<pre>
<progress>
<q>
<rp>
<rt>
<ruby>
<s>
<samp>
<script>
<section>
<select>
<small>
<source>
<span>
<strike> DEPRECATED
<strong>
<style>
<sub>
<summary>
<sup>
<table>
<tbody>
<td>
<tfoot>
<th>
<thead>
<time>
<title>
<tr>
<track>
<tt> DEPRECATED
<u>
<ul>
<var>
<video>
<wbr>