How to Group Footer Content in Table Form using HTML? Last Updated : 19 Jun, 2024 Summarize Comments Improve Suggest changes Share 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 infoAdvertise with us Next Article How to group header content of a table using HTML5 ? M manaschhabra2 Follow Improve Article Tags : HTML CSS-Misc HTML-Misc HTML-Questions CSS-Questions +1 More Similar Reads How to group the body content in a table using HTML5 ? In this article, group the body content in an <table> element in a document. It is used to define a standard cell in an HTML table. Syntax: <tbody> ... </tbody> Example 1: In this example, we use some HTML tags and make the group the body content in a table. html <!DOCTYPE html 3 min read How to group header content of a table using HTML5 ? In this article, we define to group the header content in a table by using the <th> tag in HTML to set the header cell of a table. Two types of cells in an HTML table. Header Cell: It is used to hold the header information. Standard Cell: It is used to hold the body of data. The working of bot 1 min read How to use header & footer in HTML table ? The <thead> and <tfoot> tags are used to separate the table into header and footer, which becomes useful when we are dealing with tables having a large amount of data. In this article, we would be discussing how to use the header and footer tags in HTML. For that purpose, we have created 3 min read How to Create Header Cell in a Table using HTML? A header cell in a table made with <th> tag is used to label columns or rows, helping organize information. To create a header cell in an HTML table, use the <th> element. Header cells typically contain titles for each column or row, and they are bold by default.Syntax<th> Contents 1 min read How to add table footer in HTML ? To add a table footer on an HTML table you can use the HTML tfoot tag. The footer is required when the developer wants to show the conclusion or the result of the table data in a single row. Syntax: <tfoot> // Table footer contents... </tfoot> Below example will illustrate the concept of 1 min read How to add footer for a document or section using HTML5 ? In this article, we define a footer for a document or section by using the <footer> tag. This tag in HTML is used to define a footer of HTML document. This section contains the footer information (author information, copyright information, carriers, etc). The <footer> tag is used within 1 min read Like