Open In App

HTML tbody Tag

Last Updated : 11 Jul, 2025
Comments
Improve
Suggest changes
3 Likes
Like
Report

The <tbody> tag in HTML is used to make a group of the same type of content of body element. This tag is used in HTML tables with header and footer which is known as "thread" and "tfoot". <tbody> tag is child tag of the table tag and the parent tag of <tr> and <td> tags.

Syntax:  

<tbody> // Table contents   </tbody>

Attributes: Some attributes are supported by <tbody> tag in HTML4.1 but not supported in HTML5. The list of attributes is given below:  

  • align: Set the alignment of the content.
  • valign: Set the vertical alignment of the content.
  • char: Set the alignment of content inside <thead> tag to a character.
  • charoff: It is used to set the character's content inside the <thead> tag aligned from the character specified by the char attribute.

Example:  In this example we are using the <tbody> tag to group the body content of an HTML table. It contains rows with data for "Shashank" and "GeeksforGeeks" under "Name" and "User Id."

HTML
<!DOCTYPE html>
<html>

<head>
    <title>HTML tbody Tag</title>
</head>

<body>
    <center>
        <h1>GeeksforGeeks</h1>
        <h2>tbody Tag</h2>
        <table>
            <thead>
                <tr>
                    <th>Name</th>
                    <th>User Id</th>
                </tr>
            </thead>

            <!-- tbody tag starts from here -->
            <tbody>
                <tr>
                    <td>Shashank</td>
                    <td>@shashankla</td>
                </tr>
                <tr>
                    <td>GeeksforGeeks</td>
                    <td>@geeks</td>
                </tr>
            </tbody>
            <!-- tbody tag ends here -->
        </table>
    </center>
</body>

</html>

Output: 

Supported Browsers: 


Explore