Table with Footer (tfoot) Template

Add a summary row for totals or calculations to your table using the semantic tfoot element.

The table footer is the semantically correct place for summarizing the data in the table's columns, such as providing sums, averages, or final counts.

Screenshot of a financial table with a distinct footer row that contains calculated totals.

Get Source Code → Preview →

About the Table Footer

The tfoot element is used to group footer content in an HTML table. It works in conjunction with thead and tbody to specify the distinct parts of a long table. This is especially useful for tables that are so long they might be printed across multiple pages; browsers can be instructed to repeat the header and footer on each page.

Even for on-screen display, using tfoot clearly separates your summary data from the main content, allowing for unique styling and better structure.

Key Features:

Ideal Use Cases:

Dependencies:

None. This template uses only pure HTML and CSS.

Code

Here's the full code for the table with a footer:

View Output