大网数据广告活动
Web 标准与前端开发

ARIA: aria-rowspan attribute

· 52CE 我爱测

The `aria-rowspan` attribute defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.

The aria-rowspan attribute defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.

Description

Similar to the rowspan attribute of the td and th elements, but for cells and gridcells which are not contained in a native table, the aria-rowspan attribute defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.

This attribute is intended for cells and gridcells which are not part of an HTML table. When a cell is nested in a semantic <table>, the rowspan attribute should be used when a <td> or <th> spans more than one row. If both are present, rowspan takes precedence over aria-rowspan. But, like all ARIA attributes, aria-rowspan only impacts the accessibility tree. It doesn't change your layout.

[!NOTE] ARIA modifies the accessibility tree and how assistive technology presents content to your users. ARIA doesn't change anything about an element's function, behavior, or appearance. When using non-semantic elements, you must use CSS to manage layout and appearance.

The value of aria-rowspan is an integer greater than or equal to 0 and less than the value which would cause the cell or gridcell to overlap the next cell or gridcell in the same column. Setting the value to 0 indicates that the cell or gridcell is to span all the remaining rows in the row group. The default value is 1.

Values

  • <integer>
    • : An integer greater than or equal to 0 and less than would cause a cell to overlap the next cell in the same column.

Associated interfaces

  • Element.ariaRowSpan
    • : The ariaRowSpan property, part of the Element interface, reflects the value of the aria-rowspan attribute.
  • ElementInternals.ariaRowSpan
    • : The ariaRowSpan property, part of the ElementInternals interface, reflects the value of the aria-rowspan attribute.

Associated roles

Used in roles:

Inherited into roles:

Specifications

See also

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。