October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

How to Design Accessible HTML Tables: Fix Headers First

Make HTML table relationships clear to assistive technology: choose a data table, mark headers with th, use scope where needed, and reserve ID-based associations for complex structures.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Start by making the table’s header relationships explicit in HTML: use <th> for cells that label rows or columns, <td> for data, and scope to clarify header direction when needed. Then add a concise caption, use explicit ID-based associations only for genuinely complex headers, and check that the table still makes sense when navigated cell by cell.

Confirm that a table is the right structure

Use an HTML data table when information has meaningful relationships across rows and columns. Do not use a table simply to position page elements; use CSS for visual layout instead. If data is arranged with tabs or visual spacing rather than table markup, its row-and-column relationships may not survive changes in presentation.

As an Amazon Associate I earn from qualifying purchases.

Accessible presentation depends on structure, not just appearance. Bold text, color, or borders can make a cell look like a heading, but they do not by themselves identify it as one to assistive technology. W3C WAI puts the core requirement plainly: “Header cells must be marked up with <th>, and data cells with <td> to make tables accessible.” See the W3C WAI Tables Tutorial.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Mark up headers and state their direction

Use <th> for cells that label a row or column and <td> for ordinary data. In a simple table with both row and column headers, add scope="col" to column headers and scope="row" to row headers. The scope attribute tells browsers and assistive technology which cells a header describes.

<table>
  <caption>Delivery slots</caption>
  <thead>
    <tr>
      <th scope="col">Time</th>
      <th scope="col">Monday</th>
      <th scope="col">Tuesday</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">09:00–11:00</th>
      <td>Closed</td>
      <td>Open</td>
    </tr>
  </tbody>
</table>

This table declares the days as column headers and each time slot as a row header. For basic scope guidance, see W3C WAI’s guidance on irregular tables.

Match the markup to the table’s complexity

Keep associations as simple as the structure allows. Add group markup and explicit header links only when the table’s relationships call for them.

Rank #2
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option
Table structure Markup approach What to do
One obvious header row or column <th> and <td> Keep the structure simple and confirm that the relationship is unambiguous.
Both row and column headers <th scope="col"> and <th scope="row"> State each header’s direction.
Headers span groups of rows or columns Group markup with scope="colgroup" or scope="rowgroup" Define the group structure as well as the range covered by each header.
Several headers map to a data cell, or headers change within the table Unique header id values and a headers list on relevant data cells Make each association explicit, and consider splitting the table if that would clarify it.

Use group scope for grouped headers

When headers span a group of columns or rows, define the group in the table structure and use the corresponding scope value, such as colgroup or rowgroup. The markup should describe the actual structure rather than relying on visual placement to imply which cells belong together.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use IDs and headers only when simpler scope is not enough

For a genuinely multi-level header structure, give each header a unique id, then list the relevant IDs in the headers attribute of each data cell. This is useful when a cell is associated with several headers that cannot be expressed as a straightforward horizontal or vertical relationship. W3C WAI identifies tables with repeated or changing column headers and cases where three or more headers apply to a data cell as examples where these explicit associations may be appropriate. Its guidance also recommends considering whether the content can be split into smaller tables: W3C WAI guidance on multi-level headers.

Give readers a way to identify and orient themselves

Place a concise <caption> inside the table to name its subject. A clear caption helps readers identify the table and decide whether to explore it. For an unusual structure, add a short nearby description explaining how its rows and columns are organized; make that description useful orientation, not a repetition of the caption. W3C WAI discusses captions and table descriptions in its guidance on captions and summaries.

Check the table in context

Review whether each data cell has the correct associated header or headers, whether the caption identifies the table, and whether the relationships remain understandable when moving through cells. Automated tools can help identify potential issues, but they cannot establish that a table’s meaning is clear to a person.

axe DevTools is one option for automated accessibility checks. The UK Department for Education’s axe DevTools instructions advise verifying findings to avoid both false positives and false assurances. Treat tool output as a prompt for review, not a substitute for checking the table’s structure and meaning yourself.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Keep WCAG techniques in perspective

W3C’s H51 is a documented technique related to WCAG 2.2 Success Criterion 1.3.1, but W3C describes techniques as examples rather than required implementations. The practical goal is to ensure information and relationships conveyed by the table can also be determined from its structure; H51 is not the only way to meet that outcome. See W3C’s H51 technique.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.