HTML/CSSBeginner#html#tables

How do you build a table with a header, body, and footer?

Use <table> with <thead> for column headers, <tbody> for data rows, and <tfoot> for summary rows. <th> defines header cells (bold, centered by default), <td> defines data cells, and <tr> defines rows.

Example
<table>
  <thead><tr><th>Item</th><th>Price</th></tr></thead>
  <tbody>
    <tr><td>Book</td><td>$10</td></tr>
  </tbody>
  <tfoot><tr><td>Total</td><td>$10</td></tr></tfoot>
</table>

Related Questions

1
HTML/CSSIntermediate#html#tables

How do colspan and rowspan work in tables?

Open
2
HTML/CSSBeginner#html#media

How do you embed audio and video with fallback controls?

Open
3
HTML/CSSIntermediate#html#media

What is the <picture> element used for?

Open