ExampleAn HTML table with a <thead>, <tbody>, and a <tfoot> element:
Month Savings January $100 February $80 Sum $180
Definition and Usage
<thead> tag is used to group header content in an HTML table.
<thead> element is used in conjunction with the <tbody> and <tfoot> elements to specify each part of a table (header, body, footer).
Browsers can use these elements to enable scrolling of the table body independently of the header and footer. Also, when printing a large table that spans multiple pages, these elements can enable the table header and footer to be printed at the top and bottom of each page.
<thead> element must have one or more <tr> tags inside.
<thead>, <tbody>, and <tfoot> elements will not affect the layout of the table by default. However, you can use CSS to style these elements (see example below)!
<thead> tag also supports the Global Attributes in HTML.
<thead> tag also supports the Event Attributes in HTML.