The HTML5 tbody Tag
Grouping the body content for tables that are included within the HTML document is necessary. Hence the use of HTML5 <tbody> tag is also very important.
Using the HTML5 <tbody> tag has to be done along with <thead> and <tfoot> tags. Using these with the HTML5 <tbody> tag is needed to be able to determine the different parts of the table like the header, body and footer.
When the HTML5 <tbody> tag is used along with the other necessary elements, the browsers will be able to display the different parts properly and it would be possible to scroll the body separately from the header and footer. Even when printing out the page, the header remains on top of the page and footer is printed at the bottom, despite multiple pages.
When the use of <tbody> tag is compared in HTML5 and HTML4.01, there will be a lot of differences that have to be dealt with. Most of the attributes in HTML4.01 are no longer supported in HTML5.
The table below clarifies the attributes for HTML5 <tbody> tag.
Attribute |
Value |
Description |
align |
right |
This is no longer supported in HTML5 |
char |
character |
This is no longer supported in HTML5 |
charoff |
number |
This is no longer supported in HTML5 |
valign |
top |
This is no longer supported in HTML5 |
The good thing about the HTML5 <tbody> tag is that it provides support for the Event Attributes and Global Attributes. It is also recognized in various web browsers like Internet Explorer, Google Chrome, Safari, Opera and Firefox.