HTML Tables
Caption, Head, Body and Foot
Bigger tables should be split into meaningful parts. This helps screen readers, printing and styling.
<table>
<caption>Monthly expenses</caption>
<thead>
<tr><th>Item</th><th>Amount</th></tr>
</thead>
<tbody>
<tr><td>Rent</td><td>Rs 30,000</td></tr>
<tr><td>Internet</td><td>Rs 3,000</td></tr>
</tbody>
<tfoot>
<tr><td>Total</td><td>Rs 33,000</td></tr>
</tfoot>
</table>| Tag | Purpose |
|---|---|
<caption> | A title for the table. Must be the first child of <table>. |
<thead> | Header rows |
<tbody> | Main data rows |
<tfoot> | Summary rows such as totals |