HTML table example with role=”presentation” on it
In this example, screen readers should not treat the data table as a table because role=”presentation” removes those table semantics. For this technique to work the role=”presentation” has to be in the table element itself, not on a wrapper div. Upon testing, NVDA and Narrator comply and treat it as normal text without saying anything about the table rows or cells. Layout tables are a case where you might use role=”presentation” to make the table not look like a true data table to screen readers.
Railroad name | Years in operation | Succesor company |
---|---|---|
New York Central | 1853-1968 | Penn Central |
Pennsylvania Railroad | 1846-1968 | Penn Central |
Penn Central | 1968-1971 (company existed until 1976) | Conrail / Amtrak |
Norfolk & Western | 1838-1982 | Chessie System / CSX |
Baltimore & Ohio | 1830-1972 (name still used until 1987) | Norfolk Southern |
Chesapeake & Ohio | 1869-1972 | Chessie System / CSX |
For comparision here’s the same table example but with role=”presentation” removed:
Railroad name | Years in operation | Succesor company |
---|---|---|
New York Central | 1853-1968 | Penn Central |
Pennsylvania Railroad | 1846-1968 | Penn Central |
Penn Central | 1968-1971 (company existed until 1976) | Conrail / Amtrak |
Norfolk & Western | 1838-1982 | Chessie System / CSX |
Baltimore & Ohio | 1830-1972 (name still used until 1987) | Norfolk Southern |
Chesapeake & Ohio | 1869-1972 | Chessie System / CSX |