How to Group Footer Content in Table Form using HTML? Last Updated : 19 Jun, 2024 Comments Improve Suggest changes Like Article Like Report To group footer content in a table using HTML, use the <tfoot> tag. This tag works with <thead> and <tbody> to define a table's structure. The <tfoot> tag is a child of the <table> element and a parent to <tr> and <td>, ensuring organized and semantically meaningful table footers. Syntax:<tfoot> Table footer contents... </tfoot> Example: The example below shows how to group footer content in the form of a table using HTML. HTML <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Footer</title> <style> tfoot { color: blue; } table, tbody, td { border: 1px solid black; border-collapse: collapse; } </style> </head> <body> <center> <h2> The footer content in a table using HTML </h2> <table> <thead> <tr> <th>Name</th> <th> Id</th> </tr> </thead> <tbody> <tr> <td>Mukesh</td> <td>Shivam_b</td> </tr> <tr> <td>Shashank</td> <td>@shashankla</td> </tr> <tr> <td>Rahman</td> <td>@rahamD</td> </tr> </tbody> <!-- tfoot tag starts from here --> <tfoot> <tr> <td>Total user</td> <td>4</td> </tr> </tfoot> <!-- tfoot tag ends here --> </table> </center> </body> </html> Output: OutputExample 2: The example below shows how to group footer content in form of table using HTML. HTML <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Table with Footer Example</title> <style> table { width: 100%; border-collapse: collapse; } h2 { text-align: center; } th, td { border: 1px solid black; padding: 8px; text-align: center; } thead { background-color: #f2f2f2; } tfoot { background-color: #e0e0e0; font-weight: bold; } </style> </head> <body> <h2>Table with Footer Example</h2> <table> <thead> <tr> <th>Product</th> <th>Price</th> <th>Quantity</th> <th>Total</th> </tr> </thead> <tbody> <tr> <td>Item 1</td> <td>10</td> <td>2</td> <td>20</td> </tr> <tr> <td>Item 2</td> <td>15</td> <td>1</td> <td>15</td> </tr> </tbody> <tfoot> <tr> <td colspan="3">Total</td> <td>35</td> </tr> </tfoot> </table> </body> </html> Output: Output Comment More info M manaschhabra2 Follow Improve Article Tags : HTML CSS-Misc HTML-Misc HTML-Questions CSS-Questions +1 More Explore HTML BasicsHTML Introduction5 min readHTML Editors5 min readHTML Basics7 min readStructure & ElementsHTML Elements5 min readHTML Attributes8 min readHTML Headings4 min readHTML Paragraphs5 min readHTML Text Formatting4 min readHTML Block and Inline Elements3 min readHTML Charsets4 min readListsHTML Lists5 min readHTML Ordered Lists5 min readHTML Unordered Lists4 min readHTML Description Lists3 min readVisuals & MediaHTML Colors11 min readHTML Links Hyperlinks3 min readHTML Images7 min readHTML Favicon4 min readHTML Video4 min readLayouts & DesignsHTML Tables10 min readHTML Iframes4 min readHTML Layout4 min readHTML File Paths3 min readProjects & Advanced TopicsHTML Forms5 min readHTML5 Semantics6 min readHTML URL Encoding4 min readHTML Responsive Web Design11 min readTop 10 Projects For Beginners To Practice HTML and CSS Skills8 min readTutorial ReferencesHTML Tags - A to Z List15+ min readHTML Attributes Complete Reference8 min readHTML Global Attributes5 min readHTML5 Complete Reference8 min readHTML5 MathML Complete Reference3 min readHTML DOM Complete Reference15+ min readHTML DOM Audio/Video Complete Reference2 min readSVG Element Complete Reference5 min readSVG Attribute Complete Reference8 min readSVG Property Complete Reference7 min readHTML Canvas Complete Reference4 min read Like