Example 1 — Read ariaRowCount
Log the total row count from a partially rendered table.
const el = document.getElementById("semantic-table");
console.log(el.ariaRowCount); // "100"
// HTML: <table … aria-rowcount="100"> with only some rows in the DOM How It Works
- Find the table.
getElementByIdreturns the table/grid host. - Read the reflection.
ariaRowCountreturns thearia-rowcountstring. - Interpret
"100". The full dataset has 100 rows, even if fewer are rendered. - Missing attribute. If unset, many browsers return
null.

