THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

HTML <th> scope Attribute

HTML th Reference HTML <th> tag

Example

Specify that the two header cells are headers for columns:

<table>
  <tr>
    <th></th>
    <th scope="col">Month</th>
    <th scope="col">Savings</th>
  </tr>
  <tr>
    <td>1</td>
    <td>January</td>
    <td>$100</td>
  </tr>
  <tr>
    <td>2</td>
    <td>February</td>
    <td>$80</td>
  </tr>
</table>
Try it yourself »

Definition and Usage

The scope attribute specifies whether a header cell is a header for a column, row, or group of columns or rows.


Browser Support

Attribute
scope Yes Yes Yes Yes Yes

The scope attribute has no visual effect in ordinary web browsers, but can be used by screen readers.


Differences Between HTML 4.01 and HTML5

NONE.


Syntax

<th scope="col|row|colgroup|rowgroup">

Attribute Values

Value Description
col Specifies that the cell is a header for a column
row Specifies that the cell is a header for a row
colgroup Specifies that the cell is a header for a group of columns
rowgroup Specifies that the cell is a header for a group of rows

HTML th Reference HTML <th> tag