Element: thuộc tính ariaColSpan

Baseline 2023
Newly available

Since October 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

Thuộc tính ariaColSpan của giao diện Element phản chiếu giá trị của thuộc tính aria-colspan, định nghĩa số cột mà một ô hoặc gridcell kéo dài trong bảng, lưới hoặc treegrid.

Giá trị

Một chuỗi chứa một số nguyên.

Ví dụ

Trong ví dụ này, thuộc tính aria-colspan trên phần tử có ID spanning-heading được đặt thành "2". Sử dụng ariaColSpan chúng ta cập nhật giá trị thành "3".

html
<table>
  <thead>
    <tr>
      <th>Heading 1</th>
      <th>Heading 2</th>
      <th>Heading 3</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td colspan="2" aria-colspan="2" id="spanning-column">Spanning</td>
      <td>One</td>
    </tr>
  </tbody>
</table>
js
let el = document.getElementById("spanning-column");
console.log(el.ariaColSpan);
el.ariaColSpan = "3";
console.log(el.ariaColSpan);

Đặc tả kỹ thuật

Specification
Accessible Rich Internet Applications (WAI-ARIA)
# dom-ariamixin-ariacolspan

Tương thích trình duyệt

Xem thêm