
- HTML Home
- HTML Roadmap
- HTML Introduction
- HTML History & Evolution
- HTML Editors
- HTML Basic Tags
- HTML Elements
- HTML Attributes
- HTML Headings
- HTML Paragraphs
- HTML Fonts
- HTML Blocks
- HTML Style Sheet
- HTML Formatting
- HTML Quotations
- HTML - Comments
- HTML - Colors
- HTML - Images
- HTML - Image Map
- HTML - Frames
- HTML - Iframes
- HTML - Phrase Elements
- HTML - Code Elements
- HTML - Meta Tags
- HTML - Classes
- HTML - IDs
- HTML - Backgrounds
- HTML Tables
- HTML - Tables
- HTML - Table Headers & Captions
- HTML - Table Styling
- HTML - Table Colgroup
- HTML - Nested Tables
- HTML Lists
- HTML - Lists
- HTML - Unordered Lists
- HTML - Ordered Lists
- HTML - Definition Lists
- HTML Links
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML Color Names & Values
- HTML - Color Names
- HTML - RGB & RGBA Colors
- HTML - HEX Colors
- HTML - HSL & HSLA Colors
- HTML - HSL Color Picker
- HTML Forms
- HTML - Forms
- HTML - Form Attributes
- HTML - Form Control
- HTML - Input Attributes
- HTML Media
- HTML - Video Element
- HTML - Audio Element
- HTML - Embed Multimedia
- HTML Header
- HTML - Head Element
- HTML - Adding Favicon
- HTML - Javascript
- HTML Layouts
- HTML - Layouts
- HTML - Layout Elements
- HTML - Layout using CSS
- HTML - Responsiveness
- HTML - Symbols
- HTML - Emojis
- HTML - Style Guide
- HTML Graphics
- HTML - SVG
- HTML - Canvas
- HTML APIs
- HTML - Geolocation API
- HTML - Drag & Drop API
- HTML - Web Workers API
- HTML - WebSocket
- HTML - Web Storage
- HTML - Server Sent Events
- HTML Miscellaneous
- HTML - Document Object Model (DOM)
- HTML - MathML
- HTML - Microdata
- HTML - IndexedDB
- HTML - Web Messaging
- HTML - Web CORS
- HTML - Web RTC
- HTML Demo
- HTML - Audio Player
- HTML - Video Player
- HTML - Web slide Desk
- HTML Tools
- HTML - Velocity Draw
- HTML - QR Code
- HTML - Modernizer
- HTML - Validation
- HTML - Color Picker
- HTML References
- HTML - Cheat Sheet
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Character Entities
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
- HTML Resources
- HTML - Quick Guide
- HTML - Useful Resources
- HTML - Color Code Builder
- HTML - Online Editor
HTML - <tfoot> Tag
Introduction to <tfoot> Tag
The HTML <tfoot> tag is used to define the footer section for a table. It is used to summarize data or provide additional information about the content of the table. It is the part of the table structure and works alongside <thead> and <tbody>.
The main advantage of using the <tfoot> tag is that it allows the browsers to render the footer before loading the table body, which can improve the accessibility when dealing with the large datasets.
Syntax
Following is the syntax of HTML <tfoot> tag −
<tfoot>...</tfoot>
Attributes
HTML <tfoot> tag supports Global and Event attributes of HTML. Below mentioned attributes are deprecated so use CSS properties rather using these attributes.
Attribute | Value | Description |
---|---|---|
align | left right center justify |
Specifies the alignment of text content(Deprecated). |
bgcolor | color | Specifies the background color of each column cell(Deprecated). |
char | character | Specifies the alignment of the content to a character of each column cell(Deprecated). |
charoff | number | Specifies the number of characters to offset the column cell content from the alignment character specified by the char attribute(Deprecated). |
valign | baseline bottom middle top |
Specifies the vertical alignment of each column cell(Deprecated). |
Example : Basic Footer
Let's look at the following example, where we are going to consider the basic usage of the <tfoot> tag.
<!DOCTYPE html> <html> <body> <table border="1"> <thead> <tr> <th>Students</th> <th>English Marks</th> <th>Hindi Marks</th> </tr> </thead> <tfoot> <tr> <th colspan="3">Juliet - the best Performer!</th> </tr> </tfoot> <tbody> <tr> <td>John</td> <td>28</td> <td>25</td> </tr> <tr> <td>Peterson</td> <td>25</td> <td>25</td> </tr> <tr> <td>Juliet</td> <td>29</td> <td>29</td> </tr> </tbody> </table> </body> </html>
Example : Applying CSS
Consider the following example, where we are going to apply the CSS to the <tfoot> tag separately.
<!DOCTYPE html> <html> <style> tfoot { background-color: #3f87a6; } </style> <body> <table border="1"> <thead> <tr> <th>Items</th> <th>Price</th> </tr> </thead> <tfoot> <tr> <th>Total</th> <th>75</th> </tr> </tfoot> <tbody> <tr> <td>5-Star</td> <td>10</td> </tr> <tr> <td>Dairy-Milk</td> <td>45</td> </tr> <tr> <td>KitKat</td> <td>20</td> </tr> </tbody> </table> </body> </html>
Example : Using for Additional Text
In the following example, we are going to use the <tfoot> tag to providing the additional content about the data in the table.
<!DOCTYPE html> <html> <body> <table border="1"> <thead> <tr> <th>Student</th> <th>GradePoints</th> </tr> </thead> <tfoot> <tr> <td colspan="2">*Grades are out of 10</td> </tr> </tfoot> <tbody> <tr> <td>Suresh</td> <td>8</td> </tr> <tr> <td>Ramesh</td> <td>9</td> </tr> </tbody> </table> </body> </html>
Supported Browsers
Tag | ![]() |
![]() |
![]() |
![]() |
![]() |
---|---|---|---|---|---|
tfoot | Yes | Yes | Yes | Yes | Yes |