Content · Web Development · HTML

HTML Grouped Row Headers for Hierarchical Data

Grouped row headers are useful when several entries belong to a team, category, or region. A group heading can cover multiple rows with rowspan and scope="rowgroup".

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

Grouped row headers are useful when several entries belong to a team, category, or region. A group heading can cover multiple rows with rowspan and scope="rowgroup". 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


Each person or subentry may also have its own row header. Avoid using the spanning cell merely to save screen space if it makes reading confusing.

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


This example keeps the idea small. Copy it carefully, then follow the explanation instead of guessing what the browser will do.

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>Club points by team</caption>
    <tbody>
        <tr>
            <th scope="rowgroup" rowspan="2">Team A</th>
            <th scope="row">Alex</th>
            <td>10</td>
        </tr>
        <tr>
            <th scope="row">Maya</th>
            <td>12</td>
        </tr>
    </tbody>
</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.
  • Rowspan makes a table cell stretch across several rows.

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 points by team”, with headers such as “Team A”, “Alex”, “Maya”. 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 second team and draw the correct grid structure.
  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


  • Forgetting that rowspan occupies a grid position in the next row.
  • Do not replace actual header cells with bold ordinary cells. Header markup is part of the meaning, not just the appearance.

Key Takeaways


  • Grouped row headers are useful when several entries belong to a team, category, or region.
  • Table represents information whose row and column relationships matter.
  • Each person or subentry may also have its own row header. Avoid using the spanning cell merely to save screen space if it makes reading confusing.
Share this resourceSend this page to someone who may find it useful.