Advertisement
Home Open Editor ❯

HTML scope Attribute

Example

<table>
  <tr>
    <th scope="col">Heading</th>
    <th scope="col">Heading</th>
  </tr>
  <tr>
    <td>Table data</td>
    <td>Table data</td>
  </tr>
  <tr>
    <td>Foot data</td>
    <td>Foot data</td>
  </tr>
</table>

Try this code ❯

Meaning

The scope attribute specifies the table cells for which the current cell provides header information.

Values:

This attribute can be used in place of the header attribute and is useful for rendering assistance by nonvisual browsers.

Note: If the scope attribute is not specified, or its value is not row, col, or rowgroup, or colgroup, then browsers automatically select the set of cells to which the header cell applies.


Standard Syntax

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


Applies to:

The scope attribute can be used on the following element:

Element Attribute
<th> scope

Advertisement

Attribute Values

Value Description
col The cell is a header for a column
row The cell is a header for a row
colgroup The cell is a header for a group of columns
rowgroup The cell is a header for a group of rows
Home Open Editor ❯
Advertisement