HTML <tfoot>Tag


Examples

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

<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>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the <tfoot> tag.


Tag Definition and Usage Instructions

The <tfoot> tag is used to group footer content in an HTML table.

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

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

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


Tips and Notes

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

Tip:The <thead>, <tbody>, and <tfoot> elements do not affect the table layout by default. However, you can use CSS to style these elements and change the table's appearance.


Differences between HTML 4.01 and HTML5

In HTML5, none of the attributes of the <tfoot> tag from HTML 4.01 are supported.


Attributes

Attribute Value Description
align right
left
center
justify
char
Not supported in HTML5.Defines the alignment of content within the <tfoot> element.
char character Not supported in HTML5.Specifies which character to use to align text within the <tfoot> element.
charoff number Not supported in HTML5.Specifies the offset of the first alignment character of the content within the <tfoot> element.
valign top
middle
bottom
baseline
Not supported in HTML5.Specifies the vertical alignment of the content within the <tfoot> element.


Global Attributes

The <tfoot> tag supportsthe HTML Global Attributes。


Event Attributes

The <tfoot> tag supportsthe HTML Event Attributes。

Other Extensions