You are here: Reference > HTML > attributes > scope (td, th)

scope attribute (td, th)

Browser support:
Sets the type of header information that belongs to a table cell.
This attribute contains information for the author only, there isn't any functionality assigned to this attribute.
JavaScript page for this attribute: scope. You can find other example(s) there.

Possible values:

String that sets the type of the header information.
One of the following values:
row
The current cell provides header information for the rest of the row that contains it.
col
The current cell provides header information for the rest of the column that contains it.
rowgroup
The header cell provides header information for the rest of the row group that contains it.
colgroup
The header cell provides header information for the rest of the column group that contains it.
Default: this attribute has no default value.

Example HTML code 1:

This example illustrates the use of the scope attribute:
<table border="3px" rules="cols">
    <tr>
        <th>Fruit</th>
        <th>Cost</th>
    </tr>
    <tr>
        <td scope="row">Apple</td>
        <td>$5</td>
    </tr>
    <tr>
        <td scope="row">Pear</td>
        <td>$10.50</td>
    </tr>
</table>
Did you find this example helpful? yes no

Supported by tags:

External links:

User Contributed Comments

Post Content

Post Content