In this example, the data (first name, last name, and city) can’t be distinguished from one another without knowing which header each corresponds to. The scope attribute with the value col defines the direction of the header cells and associates them with the corresponding data cells. The scope attribute is also needed for larger tables with one header row or column.
Holidays taken in the last six months
ID |
Name |
July |
August |
September |
October |
November |
December |
215 |
Abel |
5 |
2 |
0 |
0 |
0 |
3 |
231 |
Annette |
0 |
5 |
3 |
0 |
0 |
6 |
173 |
Bernard |
2 |
0 |
0 |
5 |
0 |
0 |
141 |
Gerald |
0 |
10 |
0 |
0 |
0 |
8 |
99 |
Michael |
8 |
8 |
8 |
8 |
0 |
4 |
Example: Table with an offset column of header cells without scope=col
on col headers and scope=row
on row headers
Holidays taken in the last six months
ID |
Name |
July |
August |
September |
October |
November |
December |
215 |
Abel |
5 |
2 |
0 |
0 |
0 |
3 |
231 |
Annette |
0 |
5 |
3 |
0 |
0 |
6 |
173 |
Bernard |
2 |
0 |
0 |
5 |
0 |
0 |
141 |
Gerald |
0 |
10 |
0 |
0 |
0 |
8 |
99 |
Michael |
8 |
8 |
8 |
8 |
0 |
4 |