English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag大全

HTML: <tfoot> tag

The HTML <tfoot> tag defines a group of rows that make up the table footer in HTML. It can be used to summarize columns in a table, usually for displaying column totals. Traditionally, you will use CSS to set the style of the <tfoot> tag to highlight the column totals. This tag is also commonly referred to as the <tfoot> element.

Online Example

HTML table with <thead>, <tfoot>, and <tbody> elements:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>Basic Tutorial Website(oldtoolbag.com)</title> 
</head>
<body>
<table border="1">
  <thead>
    <tr>
      <th>Month</th>
      <th>Savings</th>
    </tr>
  </thead>
  tfoot>
    <tr>
      <td>Sum</td>
      <td>$180</td>
    </tr>
  </tfoot>
  <tbody>
    <tr>
      <td>January</td>
      <td>$100</td>
    </tr>
    <tr>
      <td>February</td>
      <td>$80</td>
    </tr>
  </tbody>
</table>
</body>
</html>
Test to see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the <tfoot> tag.

Definition and Usage

The <tfoot> tag is used to combine the footer content of the HTML table.

The <tfoot> element should be used with <thead> and <tbody> Elements combined together are used to define the various parts of the table (footer, header, body).

By using these elements, the browser is able to support the scrolling of the table body independently of the table header and footer. When printing a long table with multiple pages, the table header and footer can be printed on each page that contains the table data.

The <tfoot> tag must be used in the following situations: as a child element of the <table> element, appearing after the <caption>, <colgroup>, and <thead> elements, and before the <tbody> and <tr> elements.

Tips and Notes

Note:<tfoot> element must contain one or more <tr> tags.

Tip:<thead>, <tbody>, and <tfoot> elements do not affect the table layout by default. However, you can use CSS to define styles for these elements, thus changing the appearance of the table.

HTML 4.01 With HTML5differences

In HTML 5 No longer supports HTML 4.01 Any attribute of the <tfoot> tag.

Attribute

AttributeValueDescription
alignright
 left
 center
 justify
 char
HTML5 Not supported. Defines the alignment method for the content within the <tfoot> element.
charcharacterHTML5 Not supported. Specifies which character the content within the <tfoot> element is aligned to.
charoffnumberHTML5 Not supported. Specifies the offset of the first alignment character within the <tfoot> element.
valigntop
 middle
 bottom
 baseline
HTML5 Not supported. Specifies the vertical alignment of the content within the <tfoot> element.

Global Attributes

Support for <tfoot> tag HTML Global Attributes.

Event Attributes

Support for <tfoot> tag HTML Event Attributes.