Element.ariaColSpan is an instance property that reflects the aria-colspan attribute. Learn how it declares how many columns a cell or gridcell spans, how it relates to HTML colspan and ariaColIndex, and how to get or set it from JavaScript—with five examples and try-it labs.
01
Kind
Instance property
02
Type
String (integer)
03
Meaning
Columns spanned
04
Reflects
aria-colspan
05
Status
Baseline widely
06
Used on
Cell / gridcell
Fundamentals
Introduction
Some table cells stretch across more than one column—like a merged header or a “Spanning” cell. Assistive technologies need that width as part of the grid model.
aria-colspan declares the span count. The DOM property ariaColSpan lets you read and update it from JavaScript.
JavaScript
const el = document.getElementById("spanning-column");
console.log(el.ariaColSpan); // "2"
el.ariaColSpan = "3";
💡
Beginner tip
On a native HTML table, prefer the HTML colspan attribute for layout. Use ariaColSpan for ARIA grids / treegrids, or when you need the reflected ARIA value in script.
Concept
Understanding the Property
MDN: the ariaColSpan property of the Element interface reflects the value of the aria-colspan attribute, which defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
Reflected attribute — mirrors aria-colspan.
Get / set — readable and writable string integer.
Span width — how many columns the cell covers.
Baseline — widely available since October 2023 (MDN).
Foundation
📝 Syntax
JavaScript
ariaColSpan
Value
A string which contains an integer (the number of columns spanned).
Item
Detail
Type
string containing an integer (e.g. "2")
Reflects
aria-colspan
Applies to
cell / gridcell (table, grid, treegrid)
HTML cousin
colspan on <td> / <th>
Pattern
📋 Spanning Cell (MDN Shape)
MDN starts with a cell spanning 2 columns, then updates ariaColSpan to "3":
Assigning the property updates the reflected aria-colspan attribute. For native layout, also keep HTML colspan in sync if you rely on it for rendering.
📈 Index Pair, Attribute Sync & Snapshot
Practice pairing with column index and verify reflection.
Example 3 — Pair with ariaColIndex
Declare starting column and how many columns the cell covers.
Prefer ariaColSpan in script; keep the attribute for HTML markup.
Example 5 — Support Snapshot
Feature-detect and remember HTML colspan vs ARIA.
JavaScript
console.log({
supported: "ariaColSpan" in Element.prototype,
tip: "Prefer HTML colspan for native tables; ariaColSpan for ARIA grids",
valueType: "string integer",
status: "Baseline Widely available (MDN)"
});
Element.ariaColSpan is Baseline Widely available (MDN: across browsers since October 2023). Logos use the shared browser-image-sprite.png sprite from this project.
✓ Baseline Widely available
Element.ariaColSpan
String integer — reflects aria-colspan (columns spanned by a cell).
BaselineWidely available
Google ChromeSupported (ARIA reflection)
Yes
Microsoft EdgeSupported (ARIA reflection)
Yes
Mozilla FirefoxSupported (ARIA reflection)
Yes
Apple SafariSupported (ARIA reflection)
Yes
OperaFollow Chromium support
Yes
Internet ExplorerNo ariaColSpan IDL — use setAttribute
No
ariaColSpanBaseline
Bottom line: Use ariaColSpan to get/set aria-colspan. Keep the span aligned with visual layout (HTML colspan or grid CSS). Pair with ariaColIndex and ariaColCount for a complete column model.
Wrap Up
Conclusion
ariaColSpan reflects aria-colspan so cells and gridcells can declare how many columns they span. Use string integers, keep visuals in sync, and prefer HTML colspan for simple native tables when that is enough.
Reflected aria-colspan string for how many columns a cell covers.
5
Core concepts
📄01
Get / set
on Element
Kind
📝02
String integer
span count
Type
🔍03
Cell / gridcell
table / grid
Use
✅04
Baseline
widely available
Status
🎯05
vs colspan
HTML for layout
Tip
❓ Frequently Asked Questions
It reflects the aria-colspan attribute as a string integer that defines how many columns a cell or gridcell spans in a table, grid, or treegrid.
No. MDN marks Element.ariaColSpan as Baseline Widely available (since October 2023). It is not Deprecated, Experimental, or Non-standard.
A string that contains an integer (for example "2" or "3"), not a Number type.
On a native <td>/<th>, HTML colspan is the standard way to span columns. aria-colspan / ariaColSpan is the ARIA reflection used especially for ARIA grid/treegrid widgets (and can mirror colspan).
ariaColCount is the total columns. ariaColIndex is a cell’s starting column. ariaColSpan is how many columns that cell covers from that position.
Yes. Reading and writing ariaColSpan updates the reflected aria-colspan attribute.
Did you know?
MDN’s demo sets both HTML colspan="2" and aria-colspan="2" on the same cell—layout via HTML, ARIA reflection via the attribute/property.