Scope Of Headers | Tables | WAI Web Accessibility Tutorials - W3C
Có thể bạn quan tâm
Scope is the attribute used to define the direction and range of data cells that are covered by a header cell. For example a header cell that spans three columns with the scope value "colgroup" associates the header with the data cells in all three columns. The scope attribute should be used for all <th> cells where either the direction or range of data cell coverage needs to be clearly associated. @@@Or always?@@@. Possible values for the scope attribute are “row”, “col”, “rowgroup” or “colgroup”.
Table with header cells in one column only
This example has <th> elements for all cells in the left column of a table. The scope value “row” is used on each <th> cell to ensure that it cannot be mistaken as a header for other cells in the same column.
Belgium | Brussels |
---|---|
France | Paris |
Holland | Amsterdam |
Luxembourg | Luxembourg |
Spain | Madrid |
UK | London |
Full code Example “Table with header cells in one column only”
Table with an offset (@@@internal?@@@) column of header cells
In this table the row header cells are in the second column rather than the first. The scope values "row" and has been used on the <th> second column cells to ensure that data cells in the first column, as well as those in cells to the right of the headers are correctly associated.
PayrollRef. | Name | Jul | Aug | Sept | Oct | Nov | Dec |
---|---|---|---|---|---|---|---|
215 | Abel | 5 | 2 | 0 | 0 | 0 | 3 |
231 | Annette | 0 | 5 | 3 | 0 | 0 | 6 |
173 | Bernard | 2 | 0 | 0 | 5 | 0 | 0 |
141 | Gerald | 0 | 10 | 0 | 0 | 0 | 8 |
99 | Michael | 8 | 8 | 8 | 8 | 4 |
Full code for “Table with an offset column of header cells”
Table with headers spanning multiple rows or columns
In this example, some of the row header cells span two or more rows of data cells and one column header spans three columns.
Poster name | Color | Sizes available | ||
---|---|---|---|---|
Zodiac | Full color | A2 | A3 | A4 |
Black and white | A1 | A2 | A3 | |
Sepia | A3 | A4 | A5 | |
Angels | Black and white | A1 | A3 | A4 |
Sepia | A2 | A3 | A5 |
Full code for “Table with headers spanning multiple rows or columns”
Related WCAG2.0 Techniques
The following WCAG 2.0 technique was used in the examples above:
- H63: Using the scope attribute to associate header cells and data cells in data tables
- Previous:Caption
- Next:Multi-level Tables
Từ khóa » Html Table Td Scope Col
-
HTML |
Scope Attribute - GeeksforGeeks HTML Th Scope Attribute - W3Schools
HTML Scope Attribute - W3Schools
HTML Td Scope Attribute
H63: Using The Scope Attribute To Associate Header Cells And ... - W3C
: The Table Header Element - HTML - MDN Web Docs - Mozilla HTML Table Advanced Features And Accessibility - MDN Web Docs
Web Accessibility - University Of Hawaii System
HTML Th Scope Attribute - Dofactory
HTML - Table Headers & Scope
9.3. In Simple Tables Use The Scope Attribute To Associate Data Cells ...
Scope Attribute Should Be Used Correctly On Tables Axe Rules
HTML
Col Attribute - Stack Overflow Tables - Bootstrap
Copyright © 2022 | Thiết Kế Truyền Hình Cáp Sông Thu