html · level 2 · unit 3 · lesson 3
- meet it
- guess first
- your turn
- fix it
- nailed it
Tap a green word if you get lost.
meet it
says which way a header cell points.
Some tables have names down the side as well as along the top, like a timetable with the days down the left. The first cell of each of those rows is a , written with <th>.
To make each one clear, add scope. scope="col" means the header names the column below it. scope="row" means it names the row beside it.
A screen reader can then read out Monday, Time, 15:30 for a single cell, so a lonely time still makes sense.
<table>
<caption>After-school clubs</caption>
<thead>
<tr><th scope="col">Day</th><th scope="col">Club</th><th scope="col">Time</th></tr>
</thead>
<tbody>
<tr><th scope="row">Monday</th><td>Chess</td><td>15:30</td></tr>
<tr><th scope="row">Thursday</th><td>Drama</td><td>16:00</td></tr>
</tbody>
</table> Press show my page to see it here.
Row headers are bold too, so the first column stands out with no extra work.
guess first
How many header cells are in this table?
Guess before you run it. Wrong guesses are how you learn, and nothing is marked.
<table>
<tr><th scope="col">Fruit</th><th scope="col">Price</th></tr>
<tr><th scope="row">Apples</th><td>40p</td></tr>
<tr><th scope="row">Pears</th><td>55p</td></tr>
</table>
your turn
Your turn. Point the headers the right way.
Fill each scope blank with col or row. Day and Lunch name columns, while Monday and Tuesday name rows.
Press show my page to see it here.
- day and lunch name columnsnot checked yet
- monday and tuesday name rowsnot checked yet
fix it
The days are plain cells. Can you fix it?
Press show my page to see it here.
- friday and saturday are row headersnot checked yet
- no plain cell has a scopenot checked yet
- Friday and Saturday are not bold. What kind of cell are they?
scopeonly works on header cells, which are made with<th>.- Change both
<td scope="row">cells to<th scope="row">, closing each with</th>.
nailed it
your headers point the right way. :D
- Row headers are
<th>cells at the start of a row. scope="col"names a column,scope="row"names a row.- Screen readers read both names with each fact.
new words in your collection
- row header
- scope
This lesson isn’t saved. A free account remembers every lesson you finish.