Content · Web Development · HTML

HTML Tables with Visually Hidden Captions

A table caption can remain available to screen readers while being visually hidden when the surrounding design already supplies context. The hiding technique should keep it in the accessibility tree.

1 views Published Oct 19, 2026 Updated Oct 19, 2026 Admin

A table caption can remain available to screen readers while being visually hidden when the surrounding design already supplies context. The hiding technique should keep it in the accessibility tree. Before writing the code, picture the information as a small grid. Each label should help a reader understand the value next to it.

What You Need to Know


Use a tested visually-hidden CSS utility, not display:none or hidden, if the goal is to preserve the caption for assistive tools.

Read a table like a story about data. The caption says what you are looking at; row and column headers explain what the numbers or words mean.

Example: See It in Action


Add this example to the appropriate part of a practice HTML page. Read each line before you open the page in your browser.

This is a short HTML fragment. To try it as a webpage, put it inside the body element of a complete HTML document.

<table>
    <caption class="visually-hidden">Club attendance by month</caption>
    <tr>
        <th scope="col">Month</th>
        <th scope="col">Students</th>
    </tr>
    <tr>
        <th scope="row">April</th>
        <td>12</td>
    </tr>
</table>

Let’s Understand the Example


  • Table represents information whose row and column relationships matter.
  • Caption gives the whole data table a clear name.
  • Class is a reusable label for styling or scripts; several elements may share the same class.
  • Scope explains which table row, column or group a th cell labels.

Look at a data cell and ask: “What row and column does this value belong to?” The header elements help answer that question, including for people who navigate the table with a screen reader.

What Should You See?


You should see a grid for “Club attendance by month”, with headers such as “Month”, “Students”, “April”. The browser displays cells, but meaningful table markup also helps readers connect each cell to its labels.

Read the first data row aloud together with its column labels. If you cannot explain a value without pointing to its position on screen, strengthen the headers.

Try It Yourself


  1. Add a visually-hidden CSS class and test whether the caption is still announced.
  2. Save your changes, open or refresh the page, and compare the result with the original example.
  3. Tell a friend what your change did. If you are not sure, undo it, refresh the page, and compare.

Common Beginner Mistakes


  • Hiding the caption with display:none and accidentally removing useful context from accessibility APIs.
  • Do not replace actual header cells with bold ordinary cells. Header markup is part of the meaning, not just the appearance.

Key Takeaways


  • A table caption can remain available to screen readers while being visually hidden when the surrounding design already supplies context.
  • Table represents information whose row and column relationships matter.
  • Use a tested visually-hidden CSS utility, not display:none or hidden, if the goal is to preserve the caption for assistive tools.
Share this resourceSend this page to someone who may find it useful.