In JavaScript, the ariaColIndex property of Element reflects the aria-colindex attribute, which defines an element’s column index or position with respect to the total number of columns within a table, grid, or treegrid (MDN).
Read the notes below before you get or set this property. Prefer feature detection when support is limited.
Syntax
Use el.ariaColIndex. Start with this line.
JavaScript
el.ariaColIndex
Call
What it does
el.ariaColIndex
Primary signature.
Built into the browser. Read or assign el.ariaColIndex — no import required.
Library declarations
JavaScript
el.ariaColIndex
Parameters
Parameter
Description
Cell / header / row
Required. Where ariaColIndex is set
String integer ≥ 1
Required. Position in the full column set
Return Value
Return Value
Description
*
The current value of el.ariaColIndex.
JavaScript Examples
Example 1 — Read ariaColIndex
MDN-style header: read the reflected column-index string.
JavaScript
const el = document.getElementById("role-heading");
console.log(el.ariaColIndex); // "1"
Map visible headers. Each gets its real full-table index.
Skip gaps honestly. Showing cols 1,2,5,6 means indexes jump to "5".
Non-contiguous rule. Set index on every cell when columns are not contiguous (MDN).
Compatibility
Browser Support
Element.ariaColIndex is Baseline Widely available (MDN: across browsers since October 2023). It is not Deprecated, Experimental, or Non-standard.
✓ Baseline Widely available
Element.ariaColIndex
Reflects aria-colindex as a 1-based string integer. Pair with ariaColCount when only some columns are in the DOM.
BaselineWidely available
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
Android WebViewSupported · Modern WebView
Full support
ariaColIndexBaseline
Bottom line: Safe for modern apps. Use 1-based string indexes, keep them ≤ ariaColCount, and label non-contiguous columns on every cell.
Frequently Asked Questions
It reflects the aria-colindex attribute as a string integer that defines an element’s column index or position with respect to the total number of columns in a table, grid, or treegrid (MDN).
No. MDN marks Element.ariaColIndex as Baseline Widely available (since October 2023). It is not Deprecated, Experimental, or Non-standard.
A string that contains an integer (for example "1" or "2"), not a Number type. Values are ≥ 1 and ≤ the full column count.
1-based. The first column is "1", the second is "2", and so on (MDN).
ariaColCount is the total number of columns on the table/grid. ariaColIndex is this cell or header’s position within that total — especially when some columns are missing from the DOM.
Yes. Reading and writing ariaColIndex updates the reflected aria-colindex attribute.