HTML Guides for rowgroup
Learn how to identify and fix common HTML validation errors flagged by the W3C Validator — so your pages are standards-compliant and render correctly across every browser. Also check our Accessibility Guides.
An element with role="rowgroup" needs an ancestor with role="table", role="grid", or role="treegrid", or one of those elements has to claim it through aria-owns.
A rowgroup groups the rows of a table, the way <thead>, <tbody> and <tfoot> do in a native <table>. It only means something inside the structure it divides. With no table, grid or treegrid above it, a screen reader has no table to announce, so it can't report the number of rows and columns or let people move from cell to cell with its table commands.
This often shows up in cards or comparison layouts built from <div> elements. The rows and cells inside carry ARIA roles, but the outer container has only a class for styling. Add role="table" to that container and give it a name with aria-label or aria-labelledby, so screen readers can say which table it is. Pick grid or treegrid only when the widget lets people move between cells with the arrow keys.
The table doesn't have to be the rowgroup's direct parent. The validator accepts plain wrapper elements in between, as long as some ancestor has one of the three roles. When the rowgroup can't sit inside the table in the DOM, give it an id and list that id in aria-owns on the table.
If the content isn't really tabular, such as a short list of features in a card, remove role="rowgroup", role="row" and role="cell" together and use a list or plain text. If you remove only the rowgroup role, the validator reports each row instead. For real tabular data, a native <table> with <tbody>, <tr> and <td> gives you the same structure without any ARIA.
Invalid example
The rows sit in a rowgroup, but the wrapper around it has no table role.
<h2 id="specs-title">Technical details</h2>
<div class="specs">
<div role="rowgroup">
<div role="row">
<span role="cell">Weight</span>
<span role="cell">1.2 kg</span>
</div>
<div role="row">
<span role="cell">Battery life</span>
<span role="cell">18 hours</span>
</div>
</div>
</div>
Valid example
With role="table" and a name on the wrapper, the rowgroup has a table to belong to.
<h2 id="specs-title">Technical details</h2>
<div class="specs" role="table" aria-labelledby="specs-title">
<div role="rowgroup">
<div role="row">
<span role="cell">Weight</span>
<span role="cell">1.2 kg</span>
</div>
<div role="row">
<span role="cell">Battery life</span>
<span role="cell">18 hours</span>
</div>
</div>
</div>
The rowgroup role represents a group of rows within a tabular structure — similar to what <thead>, <tbody>, or <tfoot> provide in a native HTML <table>. According to the ARIA specification, the rowgroup role should be used on elements that serve as structural containers for rows within a grid, table, or treegrid. A <header> element is not appropriate for this role because it carries its own strong semantic meaning (typically banner or a sectioning header), and overriding it with role="rowgroup" creates a conflict that the W3C validator flags.
This matters for several reasons. First, assistive technologies rely on correct role assignments to convey the structure of a page. When a <header> element is given role="rowgroup", screen readers receive contradictory signals about what the element represents, which can confuse users. Second, the HTML specification restricts which ARIA roles can be applied to certain elements — the <header> element does not allow rowgroup as a valid role override.
To fix this issue, you have two main options:
- Replace the
<header>element with a<div>— since<div>has no implicit ARIA role, it freely acceptsrole="rowgroup". - Use native HTML table elements — replace the custom ARIA table structure with
<table>,<thead>,<tbody>,<tr>,<th>, and<td>, which provide the correct semantics without requiring any ARIA roles.
Examples
❌ Incorrect: role="rowgroup" on a <header> element
<div role="table" aria-label="Quarterly Sales">
<header role="rowgroup">
<div role="row">
<span role="columnheader">Quarter</span>
<span role="columnheader">Revenue</span>
</div>
</header>
<div role="rowgroup">
<div role="row">
<span role="cell">Q1</span>
<span role="cell">$1.2M</span>
</div>
</div>
</div>
The validator reports Bad value "rowgroup" for attribute "role" on element "header" because <header> cannot accept the rowgroup role.
✅ Fix option 1: Use a <div> instead of <header>
<div role="table" aria-label="Quarterly Sales">
<div role="rowgroup">
<div role="row">
<span role="columnheader">Quarter</span>
<span role="columnheader">Revenue</span>
</div>
</div>
<div role="rowgroup">
<div role="row">
<span role="cell">Q1</span>
<span role="cell">$1.2M</span>
</div>
</div>
</div>
A <div> is semantically neutral, so role="rowgroup" is perfectly valid on it.
✅ Fix option 2: Use native HTML table elements
<table>
<caption>Quarterly Sales</caption>
<thead>
<tr>
<th>Quarter</th>
<th>Revenue</th>
</tr>
</thead>
<tbody>
<tr>
<td>Q1</td>
<td>$1.2M</td>
</tr>
</tbody>
</table>
Native table elements like <thead> and <tbody> implicitly carry the rowgroup role, so no ARIA attributes are needed at all. This approach is generally preferred because it provides the best accessibility support out of the box and results in cleaner, more maintainable markup. Only use ARIA table roles when you cannot use native HTML tables (for example, when building a custom grid layout that requires non-table CSS).
A <tbody> element already has the ARIA role rowgroup, so adding role="rowgroup" to it repeats what browsers and screen readers already know.
HTML gives each element a default ARIA role. Inside a <table>, a <tbody> is exposed to assistive technology as a group of rows with no extra markup, and <thead> and <tfoot> get the same rowgroup role. Writing role="rowgroup" by hand changes nothing for users and makes the markup harder to read.
This usually comes from tables pasted from online word processors or built by table plugins, which put an ARIA role on every part of the table. The rowgroup role is meant for tables built from generic elements such as <div>, where nothing else tells a screen reader how the rows are grouped. A native <tbody> doesn't need it, so remove the attribute. If the same table also has role="row" on its <tr> elements or roles on its cells, remove those as well.
Invalid example
<table>
<thead>
<tr>
<th>Plan</th>
<th>Price</th>
</tr>
</thead>
<tbody role="rowgroup">
<tr>
<td>Basic</td>
<td>$10</td>
</tr>
<tr>
<td>Pro</td>
<td>$25</td>
</tr>
</tbody>
</table>
Valid example
<table>
<thead>
<tr>
<th>Plan</th>
<th>Price</th>
</tr>
</thead>
<tbody>
<tr>
<td>Basic</td>
<td>$10</td>
</tr>
<tr>
<td>Pro</td>
<td>$25</td>
</tr>
</tbody>
</table>
The <thead> element is exposed with the ARIA role rowgroup by default, so role="rowgroup" on it only states its built-in role a second time.
Every HTML element maps to a default ARIA role, and the table sections share one: <thead>, <tbody> and <tfoot> are all row groups. Browsers already tell screen readers that the rows inside a <thead> form a group at the top of the table. An explicit role="rowgroup" changes nothing users can notice, which is why the validator reports it as a warning rather than an error.
You'll often see this in tables generated by page builders, table plugins or content copied from online editors, which tend to stamp a role onto every table part. The rowgroup role exists for tables made from generic elements such as <div>, where the markup gives assistive technology no clue about how the rows are grouped. A real <thead> already carries that meaning, so delete the attribute. While you're there, check the rest of the table. In a native <table>, a role on <tr>, <th> or <td> is reported as an error, so remove those in the same pass.
Invalid example
<table>
<thead role="rowgroup">
<tr>
<th>Feature</th>
<th>Included</th>
</tr>
</thead>
<tbody>
<tr>
<td>Backups</td>
<td>Yes</td>
</tr>
<tr>
<td>Priority support</td>
<td>No</td>
</tr>
</tbody>
</table>
Valid example
<table>
<thead>
<tr>
<th>Feature</th>
<th>Included</th>
</tr>
</thead>
<tbody>
<tr>
<td>Backups</td>
<td>Yes</td>
</tr>
<tr>
<td>Priority support</td>
<td>No</td>
</tr>
</tbody>
</table>
Validate at scale.
Ship accessible websites, faster.
Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.
1K Weekly
1,000 monthly checks. Cancel anytime.
Get 1K Weekly →Join teams across 40+ countries