Content · Web Development · HTML

HTML Table Captions vs Surrounding Page Headings

A page heading names the surrounding topic, while a table caption names the particular data table. They can complement each other without repeating the same vague words.

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

A page heading names the surrounding topic, while a table caption names the particular data table. They can complement each other without repeating the same vague words. 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 specific captions when several tables appear in one article. A nearby h2 does not automatically provide the table's caption relationship.

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


Here is a simple example to experiment with. Type it, save the file, and check what the browser displays.

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

<h2>Opening hours</h2>
<table>
    <caption>Weekly opening times for the library</caption>
    <tr>
        <th scope="col">Day</th>
        <th scope="col">Hours</th>
    </tr>
    <tr>
        <th scope="row">Monday</th>
        <td>9–5</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.
  • 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 “Weekly opening times for the library”, with headers such as “Day”, “Hours”, “Monday”. 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. Write a heading and a caption that each add different information.
  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


  • Giving every table the caption Data when their contents differ.
  • Do not replace actual header cells with bold ordinary cells. Header markup is part of the meaning, not just the appearance.

Key Takeaways


  • A page heading names the surrounding topic, while a table caption names the particular data table.
  • Table represents information whose row and column relationships matter.
  • Use specific captions when several tables appear in one article. A nearby h2 does not automatically provide the table's caption relationship.
Share this resourceSend this page to someone who may find it useful.