The <caption> provides a clear, short description of the table's purpose. Screen readers use it to help users understand what the table is about.
Click to reveal answer
beginner
What is the role of <th> in accessible tables?
<th> defines header cells that describe the content of rows or columns. They help screen readers announce the header when reading table data cells.
Click to reveal answer
intermediate
How do scope attributes improve table accessibility?
The scope attribute on <th> tells screen readers if the header is for a row, column, or group. This clarifies relationships between headers and data cells.
Click to reveal answer
intermediate
What is the purpose of using summary attribute or ARIA roles in tables?
The summary attribute (though deprecated) or ARIA roles provide extra context about complex tables for screen readers, helping users understand layout and data relationships.
Click to reveal answer
beginner
Why should tables avoid using layout tables for design?
Using tables only for data keeps structure clear. Layout tables confuse screen readers because they expect tables to show data relationships, not page layout.
Click to reveal answer
Which HTML element provides a title or description for a table?
A<title>
B<summary>
C<caption>
D<header>
✗ Incorrect
The
element is used to give a table a descriptive title that screen readers announce.
What attribute on <th> helps define if it is a header for a row or column?
Ascope
Baria-label
Crole
Did
✗ Incorrect
The scope attribute specifies if the header applies to a row, column, or group, improving screen reader clarity.
Which tag should be used for table header cells?
A<th>
B<td>
C<tr>
D<thead>
✗ Incorrect
defines header cells, while
is for data cells.
Why is it bad to use tables for page layout?
AIt slows down the page
BIt confuses screen readers expecting data tables
CIt uses too much CSS
DIt breaks links
✗ Incorrect
Screen readers expect tables to show data relationships, so layout tables cause confusion.
What helps screen reader users understand complex tables better?
ARemoving headers
BAdding many colors
CUsing only <td> cells
DUsing ARIA roles and captions
✗ Incorrect
ARIA roles and captions provide extra context for screen readers on complex tables.
Explain how to make a data table accessible for screen reader users.
Think about how screen readers understand table structure.
You got /5 concepts.
Describe why using
and scope attributes is important in tables.
Headers guide users through table data.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of the <caption> element in an HTML table?
easy
A. To add a footer row at the bottom of the table.
B. To provide a title or description for the table, improving accessibility.
C. To create a header cell for each column.
D. To style the table with colors and fonts.
Solution
Step 1: Understand the role of <caption>
The <caption> element is used to give a title or description to a table, which helps screen readers and users understand the table's content.
Step 2: Compare with other options
Options B, C, and D describe other table parts or styling, but only <caption> provides a descriptive title.
Final Answer:
To provide a title or description for the table, improving accessibility. -> Option B
Quick Check:
<caption> = Table title [OK]
Hint: Caption tags give tables a clear title for screen readers [OK]
Common Mistakes:
Confusing <caption> with <tfoot> or <thead>
Thinking <caption> styles the table
Ignoring accessibility benefits of <caption>
2. Which of the following is the correct way to mark a header cell for a column in an HTML table?
easy
A. <td scope="col">Header</td>
B. <td>Header</td>
C. <th scope="row">Header</th>
D. <th scope="col">Header</th>
Solution
Step 1: Identify the correct element for header cells
The <th> element is used for header cells, not <td>.
Step 2: Understand the scope attribute
For column headers, scope="col" is correct. <th scope="col">Header</th> uses <th scope="col">, which is the proper syntax.
Final Answer:
<th scope="col">Header</th> -> Option D
Quick Check:
<th scope="col"> = Column header [OK]
Hint: Use <th> with scope="col" for column headers [OK]
Common Mistakes:
Using <td> instead of <th> for headers
Mixing scope="row" with column headers
Omitting the scope attribute
3. Given the following table snippet, what will screen readers associate the header "Name" with?