When writing in HTML, the <thead> tag is used to designate a set of rows defining the head of the columns on a table. It is useful for sectioning off parts of the table to be styled with CSS. The following sections contain information about the <thead> tag, including an example of it in use, as well as related attributes and browser compatibility.
Tip: More advanced tables may also include the <caption>, <col>, <colgroup>, <tbody>, <tfoot>, or <thead> elements.
Tip: Using the <thead> and <tfoot> elements ensures that a header and footer appear on each page of a large table printout.
<table class="mtable2 tab"> <thead> <tr> <th>Month</th> <th>Savings</th> </tr> </thead> <tbody> <tr class="tcw"> <td>March</td> <td>$200</td> </tr> <tr class="tcw"> <td>April</td> <td>$300</td> </tr> <tr class="tcw"> <td>May</td> <td>$250</td> </tr> </tbody> <tfoot> <tr class="tcw"> <td>Total</td> <td>$750</td> </tr> <tfoot> </table>
We have added a few of our own classes to the table using CSS; this action allows us to improve its appearance.
Within an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support standard attributes. Every attribute that was unique to the <thead> tag has been deprecated. While these attributes may work with the some versions of HTML, they will eventually be phased out. You should use CSS to adjust the dimensions and appearance of this element.
|align||Designates the alignment of content inside an element|
|char||Aligns the content in a <thead> element to a specific character|
|charoff||Sets the number of characters to offset the content from the character designated by the char attribute|
|valign||Alights the content in a <thead> element vertically|
|Water Wave Text Effect Code|
|Full Screen Menu with Horizontal Items|
|Bootstrap Dark Pricing Plans Table with Dynamic Particles|
|Tabs with Pink and Black Header Using Bootstrap|
|Minimum Essential Hardwares to Farm (Mine) Chia Coin|
|Chia Coin and Effect on HDD Price|
|Royal Grass Image Collection|
|Pearl Flowers Image Collection|
|14 CSS Social Buttons Code Example|
|17 CSS Background Code Example|
|17 CSS 404 Page Not Found Example|
|26 CSS Background Examples|
|24 CSS Pricing Plans Example|
|14 CSS Timeline Example|
|20 CSS Social Button Example|
|22 CSS Thumbnail Examples|