Tables present genuinely tabular data — rows and columns of related values. They're built from a few nested elements.
Table structure
<table><thead><tr><th>Name</th><th>Score</th></tr></thead><tbody><tr><td>Aanya</td><td>82</td></tr></tbody></table>
| Element | Is |
|---|---|
<table> | The whole table |
<tr> | A table row |
<th> | A header cell (bold, and read as a header) |
<td> | A data cell |
<thead>/<tbody> | Group header and body rows |
Key takeaways
- 01Tables present tabular data: <table>, <tr> (rows), <th> (headers), <td> (data cells).
- 02<thead>/<tbody> group header and body rows.
- 03Use <th> so screen readers announce header cells; add a <caption>.
- 04Never use tables for page layout — use CSS.
