Lesson 8 of 8

Readable tables

Goal

Table headers a screen reader understands

01

Explanation

A table is for data shown in rows and columns, not for laying out the parts of a page. A screen reader reads it cell by cell: if it doesn't know the headers, it reads "Physics" on its own, and if it does, it tells you the day and the period along with it.

A screen reader works out a table's headers from three things: caption gives the table a name, just as you give each section a heading; thead and tbody separate the headers from the data; and th with scope ties each header to its column (col) or its row (row).

A common mistake is putting a header in a td cell and making it bold. It looks like a header to anyone who can see it, but to a screen reader it's just another data cell.

02

Your task

Add a caption, move the header row into a thead with <th scope="col"> cells, make the day at the start of each row a <th scope="row">, and keep the subject cells as td.

Checks

5 checks
  1. The table has a title in a caption
  2. The header row is in thead with th cells
  3. Column headers have scope="col"
  4. The day heads its row in a th with scope="row"
  5. The subjects are still td cells
03

Hints

0/3
Track lessons0 of 8 done

Start with your very first HTML tag and finish with a complete interactive app.

Beginner level, 8 lessons, 1.5 hours in total.

index.html
Preview
index.html100%
–/5

Press “Run and check” to grade your code.

5 checks listed under “Your task”.

Track lessons0 of 8 done

Start with your very first HTML tag and finish with a complete interactive app.

Beginner level, 8 lessons, 1.5 hours in total.