ARIA property
aria-rowindex
Which row this is, counting from the real table.
It fixes a row's place in the full table rather than in the rendered window, so scrolling does not renumber anything.
Which roles may carry aria-rowindex
- Value
- integer
- Filed as
- A property, which is how ARIA files it and not a rule about how often it changes.
- Roles that inherit it
columnheader,gridcell,rowheader
Those lists are not advice. Browsers are required to ignore a non-global attribute sitting on a role that does not support it, so aria-rowindex on the wrong element is not weak, it is absent. You can read it in the DOM and nobody using a screen reader can.
Every role above comes from the specification's own list for this attribute, checked name for name. The normative definition stays with the W3C, in the aria-rowindex section of the ARIA specification.
Keeping aria-rowindex true
This is the one that breaks under virtual scrolling, because the row elements get recycled and the indexes ride along with them. Derive the index from the record rather than from the DOM position and it stays right on its own. Sorting is the other trigger. Re-sort the table and every index is now attached to the wrong row, with nothing on screen to show for it.
How aria-rowindex gets checked
There are test rules that check an ARIA attribute is one that exists, is allowed on the role underneath it, and carries a value of the right type. What they map to is ARIA's own author requirements rather than any WCAG criterion, so a misplaced attribute breaks ARIA without being a WCAG failure by itself. It becomes one under 4.1.2 Name, Role, Value the moment the missing or wrong value means the control's state cannot be worked out programmatically, which is what usually happens next.
Nothing automated catches the failure this page is about. A stale value is a valid value, on a permitted role, with the right type. It is only wrong about the world.
Attributes you will meet alongside aria-rowindex
- aria-colindex Which column a cell is in, counting from the real table rather than what is shown.
- aria-colspan How many columns a cell spans, when the markup cannot say so itself.
- aria-expanded Whether the thing this control opens is currently open.
- aria-level The depth of a heading or a tree item, counting from one.
- aria-posinset Which position this item holds in its set, when the markup does not contain the whole set.
- aria-rowspan How many rows a cell spans, when the markup cannot say so.
- aria-selected Whether an option, tab or row is the chosen one.
- aria-setsize How many items the set really holds, when only some are in the markup. Together with aria-posinset this is what makes an infinite list announce as 5 of 200.
Every ARIA state and property · Every ARIA role · ARIA explained