Skip to: content, navigation

by Ian Lloyd

scope (HTML attribute)

Browser support full matrix
IE5.5+ FF1+ Saf1.3+ Op9.2+
Full Full Full Full
Spec
Depr. Version
No HTML 4
scope="
{ col | colgroup | row | rowgroup }
"

Example

‘Acme Industries’ is associated with all the cells in that 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>

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 is used in the context of a table header - the th element - but may be used validly with a td element.

Value

The most common attributes you will use with scope are "col" and "row". However, if you have 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. There is one other attribute available, namely "rowgroup", which applies to a cell that is spanned using the rowspan attribute.

Compatibility

IE5.5Full
6.0Full
7.0Full
Firefox1.0Full
1.5Full
2.0Full
Safari1.3Full
2.0Full
3.0Full
Opera9.2Full
9.5Full

Difficult to state browser compatibility - this is more of a question of how well the assistive technology copes with this information. Regardless, it is the correct thing to do, so you should make the effort to ensure that if you have complex tables that you mark them up accordingly to ensure 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

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters