HTML <th> scope attribute
HTML <th> tag
Example
The following example identifies two of the th elements as headers for
columns, and two of the td elements as headers for rows:
<table border="1">
<tr>
<th></th>
<th scope="col">Month</th>
<th scope="col">Savings</th>
</tr>
<tr>
<td scope="row">1</td>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td scope="row">2</td>
<td>February</td>
<td>$80</td>
</tr>
</table> |
Try it yourself!
|
Definition and Usage
The scope attribute defines a way to associate header cells and data cells in
a table.
The scope attribute identifies whether a cell is a header for a column, row,
or group of columns or rows.
The scope attribute makes no visual difference in ordinary web browsers.
This attribute can be used by screen readers.
Browser Support

Since there is no visual difference in ordinary web browsers, it’s
difficult to say whether or not they support the scope attribute.
Syntax
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> tag
Learn XML with <oXygen/> XML Editor - Free Trial!
 |
|
oXygen helps you learn to define,
edit, validate and transform XML documents. Supported technologies include XML Schema,
DTD, Relax NG, XSLT, XPath, XQuery, CSS.
Understand in no time how XSLT and XQuery work by using the intuitive oXygen debugger!
Do you have any XML related questions? Get free answers from the oXygen
XML forum
and from the video
demonstrations.
Download a FREE 30-day trial today!
|
|