Web Development Course:
HTML thead: Main Tips
- In an HTML table, the
theadtag is used to group header content.
theadtag goes inside the <table> element and has <tr> elements nested inside.
theadHTML element is used together with <tbody> and <tfoot> to define parts of a table.
Creating HTML Table Headers
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>
Removed thead Tag Attributes
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
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
<thead align="char" char="S" charoff="3">
valign set all the content inside the
<thead> element to align vertically:
Note: instead of valign, use the CSS vertical-align property.
Mobile Browser Support
HTML5 Tags List: Get to Know the Most Useful Elements
Find HTML5 tags explained and illustrated with beginner-friendly HTML5 examples. Grasp the difference between HTML5 tags & elements and learn to use both!
Creating, Modifying and Styling HTML Tables
HTML table: how to create a table in HTML? Learn how to use HTML table border property and find out how to make your first table in HTML.