×

html · level 2 · unit 3 · lesson 1

  1. meet it
  2. guess first
  3. your turn
  4. fix it
  5. nailed it

Tap a green word if you get lost.

meet it

A names the whole table.

A table of numbers means little until you know what it shows. A caption is its title. Write <caption> as the very first thing inside <table>, before any row.

Browsers show it above the table, centred. Screen readers announce it first, so listeners know which table they have reached before the facts start.

Keep it short and specific: Swimming lessons, autumn term tells people far more than Table 1.

<table>
  <caption>Swimming lessons, autumn term</caption>
  <tr><th>Day</th><th>Time</th><th>Price</th></tr>
  <tr><td>Monday</td><td>17:00</td><td>£8</td></tr>
  <tr><td>Saturday</td><td>09:30</td><td>£10</td></tr>
</table>

Press show my page to see it here.

A caption beats a heading above the table, because the browser knows the caption and the table belong together.