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">
 <thead>
  <tr><th> Month </th><th> Expenses </th></tr>
 </thead>
 <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>
 </tbody>
 <tfoot>
  <tr> <td>Total</td> <td>$95000</td> </tr>
 </tfoot>
</table>
</>
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?

 

Email:

Message: