HTML tbody tag

HTML <tbody> tag defines body section of the table. It groups all the rows present in the body section of the table.

<table class="demoTable">
  <tr><th> Month </th><th> Expenses </th></tr>
 <tbody id="design">
  <tr> <td>January</td> <td>$30000</td> </tr>
  <tr> <td>Febuary</td> <td>$40000</td> </tr>
  <tr> <td>March</td> <td>$25000</td> </tr>
  <tr> <td>Total</td> <td>$95000</td> </tr>
Month Expenses
January $30000
Febuary $40000
March $25000
Total $95000

Here, the background-color of the tbody is gray. Its purpose is to distinguish it from thead and tfoot sections.

You can see the real basic structure of data is present in the tbody section.

Tag omission

Both tags may be omitted.

Global Attributes

All the global attributes are applicable on the tbody element.

Was this article helpful?