In this discussion, We will introduce about the use of <tbody> tag in html5. This tag is used to specify the group of rows in the table body. In the table we can have one or more <tbody> tag. The <tbody> tag is used in conjunction with <thead>, <tfoot> in the <table> tag. The <tbody> tag must have one or more <tr> tag within it. The <tbody> tag is the child of <table> tag and used after the <caption>, <thead>, <tfoot> tag. This tag must have opening and closing tags.
the syntax of the <tbody> tag is as:
| <tbody>One or more tr tag</tbody> |
This tag don't have any specific attribute.
Example: tbody_tag.html.
| <!DOCTYPE html> <html> <head> <title>Example of tbody tag</title> </head> <body> <table border="1"> <thead> <tr> <th>NAME</th> <th>Sr. name</th> </tr> </thead> <tbody> <tr> <td> Gyan</td> <td> Singh</td> </tr> <tr> <td> Ankit</td> <td> Kumar</td> </tr> <tr> <td> Bikrant</td> <td> Singh</td> </tr> </tbody> </table> </body> </html> |
Output:
Difference between html4.01 and html5.
None
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.