<tbody>

Description

The <table> element can be sectioned into three horizontal parts: <thead>, <tbody>, and <tfoot>.

  • <thead> contains the rows at the head of the <table>.
  • <tbody> contains the rows in the body of the <table>.
  • <tfoot> contains the rows at the foot of the <table>.

Using <thead>, <tbody>, and <tfoot> elements with the <table> element tells browsers the breakdown of the sections and allows you to apply different styles to the heading, body, and footer.

Example


<html>
<body>
     <table>
          <thead>
               <td>This cell is in the thead rows group.</td>
               <td>This cell is in the thead rows group.</td>
               <td>This cell is in the thead rows group.</td>
          </thead>
          <tbody>
               <tr>
                    <td>This cell is in the tbody rows group.</td>
                    <td>This cell is in the tbody rows group.</td>
                    <td>This cell is in the tbody rows group.</td>
               </tr>
               <tr>
                    <td>This cell is in the tbody rows group.</td>
                    <td>This cell is in the tbody rows group.</td>
                    <td>This cell is in the tbody rows group.</td>
               </tr>
          </tbody>
          <tfoot>
               <td>This cell is in the tfoot rows group.</td>
               <td>This cell is in the tfoot rows group.</td>
               <td>This cell is in the tfoot rows group.</td>
          </tfoot>
     </table>
</body><!--from   w w w.  j a v  a  2s  .com-->
</html>

Click to view the demo

The code above generates the following result.

tbody




















Home »
  HTML CSS »
    HTML CSS Reference »




HTML Tag Reference
CSS Reference
CSS Selector Reference
Encoding Reference