Check 11.03 · Semantic HTML and accessibility

Structure tables and lists with native elements

Mark up data tables with caption, thead and th scope, and lists with ul, ol, li or dl, with no layout tables and no hand-typed lists.

Priority
Important
Difficulty
Easy
Estimated time
1 to 4 h
Free, no account: your progress is saved in this browser.

Ask an AI to check this point on your site

Opens the assistant with a ready-made question: this check, its goal and your site URL.

For Gemini, Copilot or another assistant, copy the question. The link opens the chosen service directly: nothing goes through this site.

In short

A data table is written with <table>, a <caption> title, <th> headers linked to their cells by scope, and <thead> and <tbody> sections. A list is written with <ul> or <ol> and <li> items, or <dl> for term and value pairs. The check consists of replacing tables as images, <div> grids, layout tables and hand-typed lists with these native elements. Expected result: a table can be read cell by cell with its header, and a list is announced with its number of items.

Why it matters

A visual table built from <div> elements or as an image has no rows or columns as far as a program is concerned. A screen reader then reads a series of values without knowing which column each belongs to: “€29, €49, yes, no”. With real <th> elements, it announces “Pro plan, Monthly price, €49”. The same goes for lists: a <ul> is announced as “list, 5 items”, which gives the length before reading starts.

Generative engines and search engines receive the same thing. Microsoft Bing explicitly recommends bulleted lists, numbered steps and comparison tables so that its AI systems can split information into reusable segments. An HTML table keeps the association between a value, its row and its column when converted to text; an image of a table loses it, apart from unreliable character recognition.

Layout tables, inherited from the 2000s or produced by some email marketing tools and document converters, cause the opposite problem: they announce rows and columns where there is only layout.

What it improves

  • Accessibility Header and cell read together, navigation within the table, announcement of the number of items in lists. WCAG criterion 1.3.1, RGAA (French accessibility framework) criteria 5.4 to 5.8 and 9.3.
  • Generative engines Comparisons, prices, features and steps stay structured when they are reused. A plausible effect, recommended by Bing, with no guarantee of citation.
  • Search snippets Content in a list or table can be reused as is in a snippet. Nothing guarantees it.
  • Responsive design A native table can be made scrollable on mobile without losing its structure, unlike a <div> grid rearranged in CSS.

How to check

1. List the tables and their headers. In the developer tools console:

console.table([...document.querySelectorAll('table')].map((t) => ({
  titre: t.caption?.textContent.trim() || '(no caption)',
  th: t.querySelectorAll('th').length,
  thSansScope: t.querySelectorAll('th:not([scope])').length,
  thead: Boolean(t.tHead),
  role: t.getAttribute('role') || '',
  lignes: t.rows.length,
})));

A compliant data table has a caption, th elements and a thead. A table without any th is either a poorly marked-up data table or a layout table.

2. Look for fake tables and fake lists. Visually spot comparisons built as grids, then inspect them: <div class="row"> and <div class="cell"> elements point to a fake table. For lists, look for paragraphs starting with a dash or a number, and for <li> elements outside a <ul> or <ol> (the W3C Nu Html Checker flags them).

3. Run an automated audit. Lighthouse, axe DevTools and WAVE flag malformed lists (elements other than <li> directly inside a <ul>), <th> elements with no associated cell and incorrect headers attributes.

4. Listen to a table. With NVDA, move into the table and navigate with Ctrl + Alt + arrow keys: each change of column should announce the header. With VoiceOver, VO + arrow keys has the same effect.

How to implement

Before you start

How to choose:

The content… Element
compares several items against several criteria <table>
lists items in no particular order <ul>
describes steps or a ranking <ol>
pairs a term with a value or a definition <dl>
only places blocks side by side CSS Grid or Flexbox, never <table>

Reference data table:

<div class="tableau-defilant" role="region" aria-labelledby="titre-offres" tabindex="0">
  <table>
    <caption id="titre-offres">Plan comparison, prices including VAT as of 1 November 2026</caption>
    <thead>
      <tr>
        <th scope="col">Plan</th>
        <th scope="col">Monthly price</th>
        <th scope="col">Users</th>
        <th scope="col">Support</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <th scope="row">Essential</th>
        <td>€29</td>
        <td>3</td>
        <td>Email</td>
      </tr>
      <tr>
        <th scope="row">Pro</th>
        <td>€49</td>
        <td>10</td>
        <td>Email and phone</td>
      </tr>
    </tbody>
  </table>
</div>
.tableau-defilant {
  overflow-x: auto;
}

.tableau-defilant:focus-visible {
  outline: 2px solid currentColor;
}

The scrolling container gets tabindex="0" and a name so that a keyboard user can scroll the table on mobile.

For a complex table (multi-level headers, merged cells), link each cell to its headers with id and headers, or better, split it into several simple tables.

Reference lists:

<ol>
  <li>Open the dashboard.</li>
  <li>Click “Export”.</li>
  <li>Choose the CSV format.</li>
</ol>

<dl>
  <dt>Delivery time</dt>
  <dd>2 to 4 business days in mainland France</dd>
  <dt>Returns</dt>
  <dd>Free within 30 days</dd>
</dl>

Warning: list-style: none in CSS can make Safari with VoiceOver drop the list semantics. For a styled list without bullets that must still be announced as a list (menu, list of cards), add role="list" to the <ul>.

Finally, an old layout table that cannot be rebuilt right away gets role="presentation" and contains no <caption>, <th> or <thead>.

WordPress

Versions WordPress 6.4 and later.

  • Table block: in the block settings panel, turn on “Header section” to output a <thead> with <th> elements, and fill in the caption under the table, rendered as a <figcaption>. For a first column of row headers or an explicit scope, use Edit as HTML or a table plugin.
  • Table plugins: check in the generated code that they output <thead>, <th> and a caption, not a <div> grid.
  • List block: use it for any enumeration; the “Ordered list” option outputs an <ol>. Avoid paragraphs that start with a dash.
  • Content pasted from a spreadsheet or a word processor: check that it has become a Table block and not an image or a layout HTML block.

Shopify

Versions Shopify admin and Online Store 2.0 themes, all plans, November 2026.

In the rich text editor for products, pages and blog posts, open the HTML view (the <> button) to paste a complete table with <caption>, <thead> and <th scope>. For features repeated across the whole catalog, prefer metafields rendered by the theme as a <dl> or a table in the product section (sections/main-product.liquid in Dawn) or in a Custom Liquid block added to the product page:

<dl class="caracteristiques">
  <dt>Material</dt>
  <dd>{{ product.metafields.custom.matiere | escape }}</dd>
  <dt>Dimensions</dt>
  <dd>{{ product.metafields.custom.dimensions | escape }}</dd>
</dl>

Wix

Versions Wix Editor and Wix Studio, November 2026.

Wix's table and data grid elements produce their own markup: inspect the result. If the comparison does not expose real headers, insert it in an embedded HTML code element with the reference structure, or present the data as a list. In text, use the bulleted and numbered list buttons rather than dashes.

Squarespace

Versions Squarespace 7.1, November 2026.

The Text block offers bulleted and numbered lists. For a table, use a Code block with the reference HTML: column layout blocks are not tables. Check that the site's CSS does not prevent horizontal scrolling on mobile.

Webflow

Versions Webflow Designer, November 2026.

The List element outputs a <ul> or <ol> (set in Settings). In a Rich Text field, the lists in the formatting bar are native. For a table, check whether your version offers a native table element; otherwise, use an Embed element with the reference HTML rather than a grid of Div Blocks.

Laravel

Versions Laravel 11 to 13.

In Blade, generate tables from the data, headers included:

<table>
    <caption>{{ __('Plan comparison') }}</caption>
    <thead>
        <tr>
            <th scope="col">{{ __('Plan') }}</th>
            <th scope="col">{{ __('Monthly price') }}</th>
        </tr>
    </thead>
    <tbody>
        @foreach($plans as $plan)
            <tr>
                <th scope="row">{{ $plan->name }}</th>
                <td>{{ Number::currency($plan->monthly_price, 'EUR', 'fr') }}</td>
            </tr>
        @endforeach
    </tbody>
</table>

For Markdown, CommonMark's table extension (enabled in the GitHub Flavored Markdown configuration) outputs <thead> and <th>.

Next.js

Versions Next.js 15 and 16 (App Router and Pages Router).

Not all UI library table components output a <table>: some render <div> elements with ARIA roles. Prefer a component that renders native HTML:

export function ComparatifOffres({ offres }: { offres: { nom: string; prix: string }[] }) {
  return (
    <table>
      <caption>Plan comparison</caption>
      <thead>
        <tr>
          <th scope="col">Plan</th>
          <th scope="col">Monthly price</th>
        </tr>
      </thead>
      <tbody>
        {offres.map((offre) => (
          <tr key={offre.nom}>
            <th scope="row">{offre.nom}</th>
            <td>{offre.prix}</td>
          </tr>
        ))}
      </tbody>
    </table>
  );
}

In MDX, enable remark-gfm so that Markdown tables are converted into <table>. With @next/mdx and Turbopack, the default bundler since Next.js 16, declare the plugin by name in next.config.mjs: createMDX({ options: { remarkPlugins: ['remark-gfm'] } }).

Astro

Versions Astro 5 to 7.

Markdown tables are supported by default thanks to GitHub Flavored Markdown. For a comparison with row headers or a caption, write an .astro component with the reference structure.

Common mistakes

  • Table as an image: unreadable for screen readers and crawlers; at best, only its alternative text remains.
  • First row in bold <td> cells instead of <th>: visually identical, structurally absent.
  • One cell per row to simulate a list: it is a list, not a table.
  • Merging cells excessively: associations become ambiguous, even with headers.
  • CSS grid rearranged on mobile that changes the reading order compared with the DOM. See check DOM reading order (opens in a new tab).
  • Adding display: block to <table> to make it responsive: some browsers then remove the table semantics. Make the container scrollable instead.

Frequently asked questions

Do generative engines understand an HTML table better than an image of a table?

Yes. An HTML table keeps, as text, the association between each value, its row and its column, which search engines and AI systems read directly. An image of a table depends on unreliable character recognition, and often only its alternative text is used. Microsoft Bing in fact recommends HTML comparison tables for its generated answers. No format, however, guarantees being cited.

Does every table need a caption?

Yes for a data table: the caption gives the table its title, screen readers announce it when entering the table, and it helps understand the content out of context. The RGAA, the French accessibility framework, checks that a title is associated with each data table. A layout table, on the other hand, must not have one. If the design has no visible title, write a short, plain one.

How do I make a table readable on mobile without breaking its accessibility?

Place the table in a container that scrolls horizontally, with overflow-x: auto, tabindex="0", a region role and a name, so that it can be reached and scrolled with the keyboard. Avoid turning rows into stacked cards with CSS without adapting the markup, and do not set the table to display: block. For a very wide table, reduce the number of columns or split it into several tables.

When should I use a dl description list?

Use dl for term and value pairs: a glossary, product features, delivery terms, short questions and their answers. Each term goes in a dt, each value in a dd, and a term can have several values. To compare several products against the same criteria, a table works better, because it can be read by row and by column.

Updated on

Topic checklist (PDF)

And now?

In the “Semantic HTML and accessibility” topic

  1. Use header, main, nav, article and footer appropriately
  2. Use elements suited to the content
  3. Structure tables and lists with native elements
  4. Distinguish action buttons from navigation links
  5. Provide ALT text for informative images
  6. Use empty ALT for decorative images
  7. Check color contrast
  8. Test keyboard navigation
  9. Check form labels
  10. Use ARIA when necessary
  11. Check DOM reading order
  12. Avoid information available only on hover
  13. Provide text alternatives for media
  14. Check applicable WCAG guidelines
  15. Test with axe, WAVE or Lighthouse