Contents
HTML thead: Main Tips
- In an HTML table, the
theadtag is used to group header content. - HTML
theadtag goes inside the <table> element and has <tr> elements nested inside. - The
theadHTML element is used together with <tbody> and <tfoot> to define parts of a table.
Creating HTML Table Headers
The thead tag is used to define the top table row that contains the heads of the columns. In other words, it allows you to create HTML table headers:
<table border>
<thead>
<tr>
<td>Purchase</td>
<td>Price</td>
</tr>
</thead>
</table>
You can only skip the ending tag if a <tbody> or <tfoot> follows your HTML thead element immediately.
- Easy to use with a learn-by-doing approach
- Offers quality content
- Gamified in-browser coding experience
- The price matches the quality
- Suitable for learners ranging from beginner to advanced
- Free certificates of completion
- Focused on data science skills
- Flexible learning timetable
- Simplistic design (no unnecessary information)
- High-quality courses (even the free ones)
- Variety of features
- Nanodegree programs
- Suitable for enterprises
- Paid Certificates of completion
- A wide range of learning programs
- University-level courses
- Easy to navigate
- Verified certificates
- Free learning track available
- University-level courses
- Suitable for enterprises
- Verified certificates of completion
Removed thead Tag Attributes
HTML thead tag used to have a few tag-specific attributes. However, all of them have been deprecated in HTML4 and removed completely in HTML5. You can use CSS properties to achieve similar results.
align defined the alignment of content for the <thead> element:
<thead align="left">
Note: instead of align, use the CSS text-align property.
char set the alignment of content inside the <thead> according to the character specified:
<thead align="char" char="M">
charoff set the number of characters for aligning the content after the character specified by the char attribute:
<thead align="char" char="S" charoff="3">
valign set all the content inside the <thead> element to align vertically:
<thead valign="bottom">
Note: instead of valign, use the CSS vertical-align property.
Browser Support
Chrome
Edge
Firefox
IE
Opera
Safari
Mobile Browser Support
Chrome
Firefox
Opera