<

HTML <tbody> Tag

The <tbody> tag is used to group the body content in an HTML table.The <tbody> element is used in conjunction with the <thead> and <tfoot> elements to specify each part of a table (body, header, footer).

Attributes



Attribute Value Description
align right
left
center
justify
char
Not supported in HTML5.
Aligns the content inside the <tbody> element
char character Not supported in HTML5.
Aligns the content inside the <tbody> element to a character
charoff number Not supported in HTML5.
Sets the number of characters the content inside the <tbody> element will be aligned from the character specified by the char attribute
valign top
middle
bottom
baseline
Not supported in HTML5.
Vertical aligns the content inside the <tbody> element


Example



<!DOCTYPE html>
<html>
<head>
<style>
thead {color:green;}
tbody {color:blue;}
tfoot {color:red;}

table, th, td {
    border: 1px solid black;
}
</style>
</head>

<body>

<table>
  <thead>
    <tr>
      <th>Month</th>
      <th>Savings</th>
    </tr>
  </thead>
  <tfoot>
    <tr>
      <td>Sum</td>
      <td>$180</td>
    </tr>
  </tfoot>
  <tbody>
    <tr>
      <td>January</td>
      <td>$100</td>
    </tr>
    <tr>
      <td>February</td>
      <td>$80</td>
    </tr>
  </tbody>
</table>



</body>
</html>

















© copyright 2017-2022 Completedone pvt ltd.