ARIA: aria-rowcount attribute
The aria-rowcount
attribute defines the total number of rows in a table, grid, or treegrid.
Description
Some tables have hundreds, even millions, of rows. Even for tables with fewer rows, loading only a subsection of rows may be a design requirement, improve performance, or improve user experience. When only a subset of rows are loaded, you do need to let all users know that only a subset of the data is being displayed. The aria-rowcount
attribute is used to define the total number of rows in a table, grid, or treegrid.
Included on the If all of the rows are loaded and in the DOM, you don't need to include The following example shows a grid with 24 rows, of which the first row and rows 7 through 9 are displayed to the user. The The element or on an element with a role of
table
, the value is the number of rows in the full table, as an integer. If the total number of rows is not known, include aria-rowcount="-1"
, which tells the browser to not count the total number of rows.
aria-rowcount
as browsers automatically count the total number of rows. However, if the rows aren't all present in the DOM at any time, this attribute is needed to provide the number of rows when the full table size is known and to tell the browser to not automatically count the rows when the total number of rows is not known.Example
Values
Associated interfaces
Element.ariaRowCount
ariaRowCount
property, part of the Element
interface, reflects the value of the aria-rowcount
attribute.ElementInternals.ariaRowCount
ariaRowCount
property, part of the ElementInternals
interface, reflects the value of the aria-rowcount
attribute.Associated roles
Specifications
Specification Accessible Rich Internet Applications (WAI-ARIA)
# aria-rowcountSee also