CSS on a table: scope="row"

On the above page, MDN uses scope=“row” for the th in the code below. Why isn’t it used on the tr instead? After all, that defines the row.

      <th scope="row">The Clash</th>
      <td>London Calling</td>

Because it’s referring specifically to the th element, saying that it is the header for that specific row. If you look above that, there are the headers for each table column.

scope is a tool for screen readers and has no visual impact as it’s intended for accessibility purposes.


This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.