freecourses.digital
Lesson progress: 0 of 3 activities done
All lessons in HTML Basics for Beginners Lesson 6.3 of 34

Module 10: Practice Project and Validation

  1. 10.1Build a simple HTML website

Organizing tabular data accessibly

Covered here

  • How screen readers read tables
  • The scope attribute for column and row headers
  • Writing helpful captions and summaries
  • Responsive tables on small screens

Short answer

Screen readers announce the header for each cell, like Price, ₱180, but only if the table marks headers correctly. Use <th scope="col"> for column headers and <th scope="row"> for row headers. Add a caption, keep the structure simple, and let wide tables scroll sideways on phones.

How screen readers read tables

A blind visitor cannot glance at a column title. Instead, as they move from cell to cell, the screen reader reads the matching header first. With correct markup, moving through a price table sounds like: Item, Pili nuts. Price, ₱180. Without headers, they only hear ₱180 with no context.

The scope attribute

<table>
  <caption>Bus fares from Legazpi</caption>
  <thead>
    <tr>
      <th scope="col">Destination</th>
      <th scope="col">Regular</th>
      <th scope="col">Aircon</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">Naga</th>
      <td>₱180</td>
      <td>₱230</td>
    </tr>
    <tr>
      <th scope="row">Sorsogon</th>
      <td>₱120</td>
      <td>₱150</td>
    </tr>
  </tbody>
</table>

Each destination is a row header, so a screen reader can say Sorsogon, Aircon, ₱150.

Simple tables are accessible tables

  • One header row and, if needed, one header column.
  • No empty cells used for spacing.
  • No tables inside tables.
  • A caption that says what the data is and when it is from.

For very complex tables, the headers and id attributes can link cells to headers, but splitting the table is usually better.

Tables on small screens

<div class="table-wrap" style="overflow-x: auto;">
  <table>...</table>
</div>

Wrapping the table lets it scroll sideways instead of breaking the page. The tables in this lesson use exactly this method. Test on a real phone.

Try it: add scope

Add scope=“col” to the column headers, turn each subject into a row header with scope=“row”, and add a caption.

Live preview

Quick quiz

1. Which attribute links a header to its column?
2. A row header should be?
3. Best fix for a very complex table?
4. How should wide tables behave on phones?

Common mistakes

  • Bold td instead of th. Visual bold does not tell screen readers it is a header.
  • Empty spacer cells. They are read aloud as blank.
  • Tables inside tables. Nested tables are very hard to navigate.

Your action

Tick each item when you can do it. Your progress saves on this device.

Key terms

scope
An attribute that tells if a th is for a column or row.
Row header
A th that labels a row.
Column header
A th that labels a column.
headers attribute
Links a cell to specific header ids in complex tables.
Responsive table
A table that stays usable on small screens.

Questions beginners ask

Is scope required?

For simple tables, browsers often guess. Adding scope removes the guesswork.

How do I test table accessibility?

Use NVDA on Windows or VoiceOver on Mac and move through cells with the table keys.

Can I hide a caption visually?

Yes, with a visually hidden CSS class, but visible captions help everyone.

Related lessons

Need a website built or fixed while you practice? The team at Remar Digital can help.