HTML tbody Tag Tutorial

In this section, we will learn what HTML <tbody> element is and how to use it.

What is <tbody> Tag in HTML?

HTML <tbody> element stands for Table Body and this element is a container that groups the rows of a table that are part of the body of that table.

Basically, a table is divided into three parts:

  • Table Header: we use HTML <thead> element to group those rows that belong to the header part of a table.
  • Table Footer: we use HTML <tfoot> element to group those rows that belong to the footer part of a table.
  • Table Body: those rows that are neither part of the footer nor header of a table, are considered part of the body of the table and are grouped using HTML <tbody> element.

Grouping rows in a table helps us to access those elements in other languages like CSS and JavaScript faster and easier.

HTML <tbody> Tag Syntax:

<tbody> </tbody>

HTML <tbody> Tag Values

Within the body of HTML <tbody> element, we set the rows of a table that are part of the body of that table.

Example: HTML table tbody

See the Pen HTML table tbody by Omid Dehghan (@odehghan) on CodePen.

Leave a Reply