VGAR Content Requirements
Content
Tabular Data (CON-WEB-008)
Markup tabular data in accessible tables
Tables should never be used to create the visual page layout.
Data tables must use proper table headers and every table header must have the scope attribute set to column or row unless it would invalidate a data relationship. If necessary, the headers= attribute can be used to hard code how headers are to be read to the user.
Tables must also include a caption that presents screen reader users with a descriptive, unique title that identifies each table. If the table has more than 4 table headings a caption must be included that summarizes the table’s layout and functional relationships.
Requirements
No Layout Tables (CON-WEB-008-01)
Tables MUST not be used for layout purposes. Layout tables are not a direct WCAG 2.0 AA failure, however when a table is linearized it can complicate or confuse the linear order of the content (See WCAG F49 for details).
Markup Tables (CON-WEB-008-02)
All data tables MUST use THs and every TH must have scope="col" or "row" set unless any implied relationships would be untrue. In that case, headers= MUST be used to hard code how headers are read to users.
<table>
<tr>
<th scope="col">Name</th>
<th scope="col">Age</th>
<th scope="col">Birthday</th>
</tr>
<tr>
<th scope="row">Buzz</th>
<td>1</td>
<td>April 10th, 2014</td>
</tr>
</table>
Identify Tables (CON-WEB-008-03)
Data tables MUST be identified for screen readers by including the "title" of the table in its element, e.g., "Transaction History for x2304".
Note: The caption may be hidden visually with CSS.
<table>
<caption class="screen-reader-only">Transaction History</caption>
<tr>
<th scope="col">Recent Transactions</th>
<th scope="col">Post Date</th>
<th scope="col">Transaction Date</th>
</tr>
<tr>
<td>$13.42</td>
<td>08/01/2015</td>
<td>07/30/2015</td>
</tr>
</table>
Summarize Table Layout (CON-WEB-008-04)
If a data table has more than 4 table headings (THs), the layout/functionality of the table MUST be described in the caption after the "title" of the table. (e.g., Transaction History for x2304: recent transactions in column 1 and details in the next 4 columns. available actions for each transaction are available in column 6)
Note: The caption may be hidden visually with CSS.
<table>
<caption class="screen-reader-only">Transaction History for x2304:
recent transactions in column 1 and details in the next 4 columns.
Available actions for each transaction are available in column 6</caption>
<tr>
<th scope="col">Recent Transactions</th>
<th scope="col">Post Date</th>
<th scope="col">Transaction Date</th>
<th scope="col">Merchant Name</th>
<th scope="col">Balance</th>
<th scope="col">Actions</th>
</tr>
<tr>
<td>$13.42</td>
<td>08/01/2015</td>
<td>07/30/2015</td>
<td>Pat's Cats</td>
<td>$1,459.72</td>
<td><button id="view">View Check</button></td>
</tr>
</table>
Table Sorting (CON-WEB-008-05)
Sorting state MUST be announced to the screen reader and all sorting controls MUST be keyboard accessible.
<table role="grid">
<caption class="screen-reader-only">Transaction History</caption>
<tbody>
<tr>
<th scope="col" aria-sort="ascending">
<span tabindex="0" role="button">Date</span>
</th>
<th scope="col" tabindex="-1">Type</th>
<th scope="col" aria-sort="none">
<span tabindex="0" role="button">Amount</span>
</th>
</tr>
</tbody>
</table>
Test Procedures
Jim Thatcher > Tables (CON-WEB-008-01-T)
Run the Jim Thatcher Table Favelet and review the tables on the page, confirming that no tables are used for layout purposes.
Jim Thatcher > Tables (CON-WEB-008-02-T)
Run the Jim Thatcher Table Favelet and review the tables on the page, Confirm that THs are used as appropriate and every TH has scope as appropriate. If present, confirm that headers point to the correct TH's IDs.
Screen reader > Tables (CON-WEB-008-03-T)
Bring up the list of tables (or cycle through each if a list is not available) with each supported screen reader and confirm that each table is identified.
Screen reader > Tables (CON-WEB-008-04-T)
Bring up the list of tables (or cycle through each if a list is not available) with each supported screen reader and confirm that each table with more than 4 THs has its layout/functionality described after the "title".
Screen reader Tables - Sorting (CON-WEB-008-05-T)
Use a screen reader to access any table sorting functionality on the page. Confirm that sorting state is announced to the screen reader and that all sorting controls are keyboard accessible.
Related Content
WCAG Success Criteria
W3C Techniques
- H51: Using table markup to present tabular information
- H39: Using caption elements to associate data table captions with data tables
- H73: Using the summary attribute of the table element to give an overview of data tables
- H63: Using the scope attribute to associate header cells and data cells in data tables
- H43: Using id and headers attributes to associate data cells with header cells in data tables
- H44: Using label elements to associate text labels with form controls
- H65: Using the title attribute to identify form controls when the label element cannot be used
- ARIA1: Using the aria-describedby property to provide a descriptive label for user interface controls
Common Failures
- F46: Failure of Success Criterion 1.3.1 due to using th elements, caption elements, or non-empty summary attributes in layout tables
- F48: Failure of Success Criterion 1.3.1 due to using the pre element to markup tabular information
- F90: Failure of Success Criterion 1.3.1 for incorrectly associating table headers and content via the headers and id attributes
- F91: Failure of Success Criterion 1.3.1 for not correctly marking up table headers
These materials and steps outlined on this website are provided “AS IS” and are intended for illustrative purposes only. They should not be relied upon for marketing, legal, tax, financial, regulatory or other advice. You are responsible for the legal aspects of any implementation of the concepts illustrated herein. Further, Visa neither makes any warranty or representation as to the completeness or accuracy of this information, nor assumes any liability or responsibility that may result from reliance on such information. You should not act or rely on such content without seeking the advice of a professional. All brand names, logos and/or trademarks are the property of their respective owners, are used for identification purposes only, and do not necessarily imply product endorsement or affiliation with Visa.