HTML < tbody>
query_builder | Christopher PisaniThe HTML element < tbody> is a child of element < table>. A table can be split into three sections, which consists of < thead>, < tbody> and < tfoot>. Using this layout can make a browser act differently while scrolling through a table in HTML, which makes it possible for the body to be scrolled indipendently from the header and footer.
A simple example of a table using this layout
<style>
table, th, td {
padding: 5px;
border: 1px solid lightgrey;
}
thead {
color: green;
}
tbody {
color: grey;
}
tfoot {
color: blue;
}
</style>
<table>
<thead>
<tr>
<th>Product</th>
<th>Quantity</th>
</tr>
</thead>
<tbody>
<tr>
<td>Apples</td>
<td>4</td>
</tr>
<tr>
<td>Oranges</td>
<td>6</td>
</tr>
<tr>
<td>Bananas</td>
<td>3</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>Total</td>
<td>13</td>
</tr>
</tfoot>
</table>
Available Attributes
No specific attributes are assigned for this element, other than the standard global attributes.