0
0
HTMLmarkup~20 mins

Table accessibility basics in HTML - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Table Accessibility Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Why use in tables?
What is the main purpose of the element in an HTML table for accessibility?
ATo provide a visible title or description for the table that screen readers announce.
BTo add a footer note at the bottom of the table.
CTo create a clickable link inside the table header.
DTo style the table with colors and borders.
Attempts:
2 left
💡 Hint
Think about how screen readers understand what a table is about.
📝 Syntax
intermediate
2:00remaining
Correct use of for headers
Which option correctly marks the first row as header cells in a table for accessibility?
HTML
<table>
  <tr>
    <td>Product</td>
    <td>Price</td>
  </tr>
  <tr>
    <td>Apple</td>
    <td>$1</td>
  </tr>
</table>
A
&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;td&gt;Product&lt;/td&gt;
      &lt;td&gt;Price&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Apple&lt;/td&gt;
      &lt;td&gt;$1&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
B
&lt;table&gt;
  &lt;tr&gt;
    &lt;td&gt;Product&lt;/td&gt;
    &lt;td&gt;Price&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;th&gt;Apple&lt;/th&gt;
    &lt;th&gt;$1&lt;/th&gt;
  &lt;/tr&gt;
&lt;/table&gt;
C
&lt;table&gt;
  &lt;tr&gt;
    &lt;th&gt;Product&lt;/th&gt;
    &lt;th&gt;Price&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Apple&lt;/td&gt;
    &lt;td&gt;$1&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
D
&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Product&lt;/th&gt;
      &lt;td&gt;Price&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Apple&lt;/td&gt;
      &lt;td&gt;$1&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
Attempts:
2 left
💡 Hint
Headers should use the tag, not .
selector
advanced
2:00remaining
Selecting header cells for row headers
Which CSS selector correctly styles all row header cells in a table for accessibility?
Atable td[scope="row"] { font-weight: bold; }
Btable td[scope="col"] { font-weight: bold; }
Ctable th[scope="col"] { font-weight: bold; }
Dtable th[scope="row"] { font-weight: bold; }
Attempts:
2 left
💡 Hint
Row headers use with a specific scope attribute.
layout
advanced
2:00remaining
Responsive table design for accessibility
Which CSS approach best helps make a wide table accessible on small screens?
AUse overflow-x: auto on a container around the table to allow horizontal scrolling.
BHide some columns with display: none to fit the screen.
CSet table width to 100% and use fixed column widths with px units.
DUse float: left on table cells to stack them vertically.
Attempts:
2 left
💡 Hint
Think about preserving all data while allowing easy navigation on small screens.
accessibility
expert
3:00remaining
Using ARIA roles for complex tables
In a complex data table with merged cells, which ARIA role helps assistive technologies understand the table structure best?
Arole="presentation" on the table element
Brole="grid" on the table element
Crole="button" on the table element
Drole="list" on the table element
Attempts:
2 left
💡 Hint
This role treats the table like a grid of cells with keyboard navigation support.