Skip to main content

HTML Guide

The “scope” attribute on the “td” element is obsolete. Use the “scope” attribute on a “th” element instead.

The scope attribute must be used on a th element, not a td element.

The scope attribute helps define whether a header cell (th) refers to a column, row, or group of columns or rows in a table. According to current HTML standards, only th elements should use the scope attribute. Using scope on td elements is obsolete and invalidates your markup. To fix this, replace any td with scope with a th, and set the appropriate scope value (row, col, etc.).

Incorrect HTML Example (with validation error):

<table>
  <tr>
    <td scope="row">Monday</td>
    <td>Meeting</td>
  </tr>
</table>

Corrected HTML Example:

<table>
  <tr>
    <th scope="row">Monday</th>
    <td>Meeting</td>
  </tr>
</table>

Key points:

  • Use scope="row" for row headers and scope="col" for column headers, but only on th elements.
  • Never use the scope attribute on a td element.

Learn more:

Related W3C validator issues