third_party/aria-practices/src/content/patterns/table/examples/table.html
The below example illustrates an implementation of the WAI-ARIA Table Pattern. Note that when possible, using a native HTML table element is recommended.
Similar examples include:
aria-sort in the headers of sortable columns.Students currently enrolled in WAI-ARIA 101 for the coming semester
First NameLast NameCompanyAddress
FredJacksonAcme, Inc.123 Broad St.
SaraJamesAcme, Inc.123 Broad St.
RalphJeffersonXYZ, Inc.456 Main St.
NancyJensenXYZ, Inc.456 Main St.
Not Applicable
| Role | Attribute | Element | Usage |
|---|---|---|---|
table | div | Identifies the element containing the table structure. | |
aria-label="Students" | div | Provides an accessible name for the table. | |
aria-describedby="IDREF" | div | Refers to the element that serves as the caption for the table. | |
rowgroup | div |
|
| row | | div | Identifies each element that contains the cells for a row. |
| columnheader | | span | Identifies elements that serve as a cell containing a column label. |
| cell | | span | Identifies elements containing content for a single cell. |
To copy the following HTML code, please open it in CodePen.