English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
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.
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 ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the <tfoot> tag.
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.
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.
In HTML 5 No longer supports HTML 4.01 Any attribute of the <tfoot> tag.
Attribute | Value | Description |
---|---|---|
align | right left center justify char | HTML5 Not supported. Defines the alignment method for the content within the <tfoot> element. |
char | character | HTML5 Not supported. Specifies which character the content within the <tfoot> element is aligned to. |
charoff | number | HTML5 Not supported. Specifies the offset of the first alignment character within the <tfoot> element. |
valign | top middle bottom baseline | HTML5 Not supported. Specifies the vertical alignment of the content within the <tfoot> element. |
Support for <tfoot> tag HTML Global Attributes.
Support for <tfoot> tag HTML Event Attributes.