1.3.1 Info and Relationships
This document provides information about the Acquia Web Governance accessibility (glossary term, activate to view definition) check:
pre element used to create a table?This check identifies instances where the <pre> tag is used to present data in a table or column-based layout. When the <pre> element is used for visual layouts, screen reader users and others may find it difficult to understand and navigate the data structure properly.
Problems can occur when the <pre> element is used to simulate tables because this method relies on visual spacing and monospaced fonts to align data. This method provides no structural information to assistive technologies (glossary term, activate to view definition). Screen reader users cannot navigate between rows and columns or understand the relationships between data points. Users who require text resizing may find that simulated tables become unreadable when the font size is increased.
This check affects the following users who have:
The data is structured with semantic HTML table elements. This allows for clear navigation and interpretation by assistive technology.
HTML
<table>
<tr>
<th>Name</th>
<th>Role</th>
</tr>
<tr>
<td>Jane Doe</td>
<td>Developer</td>
</tr>
</table>The data is formatted into columns with white space inside a <pre> tag, which lacks semantic meaning and table structure.
HTML
<pre>
Name Role
Jane Doe Developer
John Smith Designer
</pre>This section provides information on how to review and fix the issue.
Identify any <pre> elements on the page and determine if they present tabular data. You can use the Web Governance Browser Extension to identify the element on the page or in the HTML source code. Determine if the content relies on visual alignment to represent a grid or columns. If the answer is yes, the check fails and you must restructure the content.
Replace the <pre> tags with semantic HTML table elements. Use the <table> tag to define the table:
Use<tr> for rows
Use <th> for headers
Use <td> for data cells
This ensures that screen readers can correctly announce the data and allow users to navigate through the rows and columns. If the content is not a table but requires specific formatting, you can use CSS for layout instead of the <pre> tag.
This section contains useful resources for this subject.
pre element used to create a table?This check identifies instances where the <pre> tag is used to present data in a table or column-based layout. When the <pre> element is used for visual layouts, screen reader users and others may find it difficult to understand and navigate the data structure properly.
Problems can occur when the <pre> element is used to simulate tables because this method relies on visual spacing and monospaced fonts to align data. This method provides no structural information to assistive technologies (glossary term, activate to view definition). Screen reader users cannot navigate between rows and columns or understand the relationships between data points. Users who require text resizing may find that simulated tables become unreadable when the font size is increased.
This check affects the following users who have:
The data is structured with semantic HTML table elements. This allows for clear navigation and interpretation by assistive technology.
HTML
<table>
<tr>
<th>Name</th>
<th>Role</th>
</tr>
<tr>
<td>Jane Doe</td>
<td>Developer</td>
</tr>
</table>The data is formatted into columns with white space inside a <pre> tag, which lacks semantic meaning and table structure.
HTML
<pre>
Name Role
Jane Doe Developer
John Smith Designer
</pre>This section provides information on how to review and fix the issue.
Identify any <pre> elements on the page and determine if they present tabular data. You can use the Web Governance Browser Extension to identify the element on the page or in the HTML source code. Determine if the content relies on visual alignment to represent a grid or columns. If the answer is yes, the check fails and you must restructure the content.
Replace the <pre> tags with semantic HTML table elements. Use the <table> tag to define the table:
Use<tr> for rows
Use <th> for headers
Use <td> for data cells
This ensures that screen readers can correctly announce the data and allow users to navigate through the rows and columns. If the content is not a table but requires specific formatting, you can use CSS for layout instead of the <pre> tag.
This section contains useful resources for this subject.
If this content did not answer your questions, try searching or contacting our support team for further assistance.
If this content did not answer your questions, try searching or contacting our support team for further assistance.