Horje
HTML scope Attribute

Definition and Usage

The scope attribute specifies whether a header cell is a header for a column, row, or group of columns or rows.

The scope attribute has no visual effect in ordinary web browsers, but can be used by screen readers.


Applies to

The scope attribute can be used on the following element:

Element Attribute
<th> scope

Browser Support


How to Specify that the two header cells are headers for columns - HTML scope Attribute

The th scope attribute.
index.html
Example: HTML
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
  border: 1px solid black;
}
</style>
</head>
<body>

<h1>The th scope attribute</h1>

<table>
  <tr>
    <th></th>
    <th scope="col">Month</th>
    <th scope="col">Savings</th>
  </tr>
  <tr>
    <td>1</td>
    <td>January</td>
    <td>$100</td>
  </tr>
  <tr>
    <td>2</td>
    <td>February</td>
    <td>$80</td>
  </tr>
</table>

</body>
</html>

Output should be:

How to Specify that the two header cells are headers for columns - HTML scope Attribute




html scope attribute

Type:
Develop
Category:
Web Tutorial
Sub Category:
HTML Attribute
Uploaded by:
Admin


Read Article
https://develop.horje.com/learn/1434/reference