The HTML Elements for the Table Body Tag

In HTML5
2 min read

The <tbody> HTML element is used to group one or more table rows (<tr>) in an HTML table (<table>). It is a container for the body content of the table, separating it from the table header (<thead>) and table footer (<tfoot>).

Code Example

<table>
<thead>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
</thead>
<tbody>
<tr>
<td>John Doe</td>
<td>25</td>
</tr>
<tr>
<td>Jane Smith</td>
<td>30</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>Total:</td>
<td>55</td>
</tr>
</tfoot>
</table>

Attributes

  • align: Aligns the contents of the <tbody> to either left, right, or center.
  • charset: Specifies a character set for the contents of the <tbody>.
  • hspace: Specifies the horizontal space in pixels around the <tbody>.
  • valign: Aligns the contents of the <tbody> vertically to either the top, bottom, or middle.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Carlos Baez

Subscribe now to keep reading and get access to the full archive.

Continue Reading