Loading...
HTML <tbody> Tag

HTML <tbody> Tag

In this tutorial, we will learn about tbody tag in HTML with the help of examples.


<tbody> Tag

Tbody tag <tbody> is used to group the body content in an HTML table.

Note : THe <tbody> tag is used in conjuction with the <thead> and <tfoot> tag to specify each part of a table.

Syntax

<tbody>..........</tbody>

Example

<!DOCTYPE html>
<html>
  <head>
    <title>tbody tag</title>
  </head>
  <body>
    <table>
      <thead>
      <tr>
        <th>First Name</th>
        <th>Last Name</th>
        <th>Age</th>
      </tr>
      </thead>
      <tbody>
      <tr>
        <td>Sunny</td>
        <td>Chaudhary</td>
        <td>20</td>
      </tr>
      <tr>
        <td>Anu</td>
        <td>Chaudhary</td>
        <td>19</td>
      </tr>
      </tbody>
    </table>
  </body>
</html>

Output

Image Not Loaded

Specific Attribute

Attribute Value Description
align right
left
center
justify
char
It is used for visual alignment
char character It is used to specify which character to align text on. It is used when align = char
charoff pixels
percentage(%)
It is used to specify an alignment offset(either in pixels or percentage value) against the first character as specified with the char attribute. It is used when align = char
valign top
middle
bottom
baseline
It is used for vertical alignment

Global Attribute

Tbody Tag support all the global attributes of HTML.


Event Attribute

Tbody Tag support all the event attributes of HTML.


Next Tutorial

We hope that this tutorial helped you develop better understanding of the concept of <tbody> tag in HTML.

Keep Learning : )

In the next tutorial, you'll learn about HTML <td> Tag.

- Related Topics