An example format/layout of the table...
<table>
<caption>
Some Caption Text
</caption>
<thead>
<tr>
<th scope="col">Col Header Text</th>
<th scope="col">More Col Header Text</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row Text>
<td>More Row Text</td>
</tr>
<tr>
<td>Row Text>
<td>More Row Text</td>
</tr>
<tr>
<td>Row Text>
<td>More Row Text</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="2">Footer Section>
</tr>
</tfoot>
</table>
Note...
The <th scope="col"> means that the header is a column header
If we used <th scope="row"> then it would be a row header
(Although you do not have to include the scope command...it's
probably more use for screen readers)
For more information see Table Info
Result of an example format/layout of the table...
Col Header Text | More Col Header Text |
---|---|
Row Text | More Row Text |
Row Text | More Row Text |
Row Text* | More Row Text |
Footer Section |
Spread over 3 columns (uses colspan="3") | ||
---|---|---|
Month | Sales | Total |
July | 7 | £1,500.00 |
August | 12 | £4,200.00 |
September | 16 | £3,200.00 |
October | 15 | £3,000.00 |
Grand Total = £11,900.00 |
Spread over 3 columns | ||
---|---|---|
Month | Sales | Total |
July | 7 | £1,500.00 |
August | 12 | £4,200.00 |
September | 16 | £3,200.00 |
October | 15 | £3,000.00 |
Grand Total = £11,900.00 |
Spread over 3 columns | ||
---|---|---|
Month | Sales | Total |
July | 7 | £1,500.00 |
August | 12 | £4,200.00 |
September | 16 | £3,200.00 |
I want another heading here | ||
October | 15 | £3,000.00 |
Grand Total = £11,900.00 |
Which makes a <td> spread downwards - over 2 rows...I also make it spread 'Relax' over 3 rows.
Saturday | Sunday | |
---|---|---|
Morning | Work | Relax |
Afternoon | ||
Evening | Dinner |