Skip to: content, navigation

scope (HTML attribute)

Spec
Depr. Version
No HTML 4
Browser support (more…)
IE5.5+ FF1+ SA1.3+ OP9.2+
Full Full Full Full

Syntax

scope=" { col | colgroup | row | rowgroup } "

Description

The scope attribute provides a mechanism for associating the cell to which the attribute is applied with a column or row of data. Normally this attribute is used in the context of a table header—the th element—but it may be used validly with a td element.

Example

The information “Acme Industries” is associated with all the cells in its row:

<tr>
  <th>Company</th>
  <th>Employees</th>
  <th>Founded</th>
</tr>
<tr>
  <td scope="row">Acme Industries</td>
  <td>1000</td>
  <td>1978</td>
</tr>

Value

The most common attributes you’ll use with scope are "col" and "row". However, if you’ve also marked up your table with colgroup elements, you can make use of the matching "colgroup" value to associate the header with all the columns in that colgroup. One other attribute is available: "rowgroup", which applies to a cell that’s spanned using the rowspan attribute.

Compatibility

Internet Explorer Firefox Safari Opera
5.5 6.0 7.0 1.0 1.5 2.0 1.3 2.0 3.0 9.2 9.5
Full Full Full Full Full Full Full Full Full Full Full

It’s difficult to state the browser compatibility for this attribute, as the issue depends on how well the assistive technology copes with this information. Regardless, the use of headers is the correct thing to do, so if you have complex tables, make an effort to ensure that you mark them up in a way that ensures that the data is accessible for all.

User-contributed notes

There are no comments yet.

Add a note

To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

Related Products

Search