哪些 ARIA 角色和属性适合非语义 table?
What ARIA roles and attributes are appropriate for a non-semantic table?
我正在以两种方式呈现 tables 数据,一种使用语义 table 标签,另一种使用 css 的非语义组 <div>
s display: table
等
<div class="table">
<div class="table-header">
<div class="table-header-row">
<div class="table-header-cell"></div>
</div>
</div>
<div class="table-body">
<div class="table-body-row">
<div class="table-body-cell"></div>
</div>
</div>
</div>
我仍然希望非语义 table 尽可能易于访问,所以我想知道我可以使用哪种 ARIA 属性组合来向用户描述他们正在与 table 或类似 table 的东西?我从未见过 "table" "table-row" 或类似的角色.. 所以我不确定我是否理解正确需要什么?
来自http://www.w3.org/TR/wai-aria/roles#grid
grid (role)
A grid is an interactive control which contains cells of tabular data
arranged in rows and columns, like a table.
另见 treegrid, row, rowgroup, gridcell, rowheader and columnheader
但是,如果这些合适,那么您可能应该使用 HTML table。
我正在以两种方式呈现 tables 数据,一种使用语义 table 标签,另一种使用 css 的非语义组 <div>
s display: table
等
<div class="table">
<div class="table-header">
<div class="table-header-row">
<div class="table-header-cell"></div>
</div>
</div>
<div class="table-body">
<div class="table-body-row">
<div class="table-body-cell"></div>
</div>
</div>
</div>
我仍然希望非语义 table 尽可能易于访问,所以我想知道我可以使用哪种 ARIA 属性组合来向用户描述他们正在与 table 或类似 table 的东西?我从未见过 "table" "table-row" 或类似的角色.. 所以我不确定我是否理解正确需要什么?
来自http://www.w3.org/TR/wai-aria/roles#grid
grid (role)
A grid is an interactive control which contains cells of tabular data arranged in rows and columns, like a table.
另见 treegrid, row, rowgroup, gridcell, rowheader and columnheader
但是,如果这些合适,那么您可能应该使用 HTML table。