我有一个表格,其中包含一个“全选”复选框作为标题行的第一列。
问题是列标题在表示其列的数据类型时非常有意义,但这个 th 的内容只是一个带有“全选”标签的复选框。
就像现在一样,它设置了与其列中所有复选框的关系,我们基本上是说所有复选框都与“全选”相关。
有没有办法在表格标题中标记一个“全选”复选框,以便标签方面的关系被它下面的所有复选框破坏?
我已经读过将包含“全选”复选框的表头中的 th 更改为 td 将解决此问题(确实如此),但很好奇是否有另一种解决方案不需要我影响标记标题。
对于复选框表格标题和表格单元格,屏幕阅读器如下所示:
这是管理课程表。具有 3 行和 6 列的表 第 1 行 选择此表中的所有项目 列 1 选择此表中的所有项目 复选框未选中
第 2 行选择此表中的所有项目 第 1 列 Dev ILT 1 复选框未选中
如您所见,将课程“Dev ILT 1”的选择复选框宣布为“选择此表中的所有项目”具有误导性
代码示例。这只是标题和正文部分。代码示例中并未列出所有行或标题,因为它不相关
<thead>
<tr class="thead-main">
<th align="center" scope="col" valign="top" class="colheadcheckbox">
<input type="checkbox" aria-label="Select all items in this table" onclick="SelectAllCheckbox.CheckUncheckAll(this, 'selectedID')" id="SelectAll">
<label for="SelectAll"><span class="hidden">Select all items in this table.</span></label>
</th>
<th scope="col" align="left" valign="middle" class="colhead">
<a href="?reverseSortBy=Name" title="Sort this column by descending order" class="sortdown">
<span> Name </span>
<img src="/geonext/images/skins/simple/schemes/dalmatian/indicator_sort_up.png" width="9" height="9" border="0" alt="This column is sorted by ascending order" title="This column is sorted by ascending order"> </a>
</th>
<th scope="col" align="left" valign="top" class="colhead">
<a href="?sortBy=Code" title="Sort this column by ascending order"> Course Code </a>
</th>
<th scope="col" align="left" valign="top" class="colhead">
<a href="?sortBy=class" title="Sort this column by ascending order"> Type </a>
</th>
</tr>
</thead>
<tbody>
<tr class="first odd">
<td align="center" valign="middle" class="">
<input type="checkbox" class="checkbox with-font" name="selectedID" id="selectedID2" value="2">
<label for="selectedID2"><span class="hidden"> 2</span></label>
</td>
<td class="sorted" align="Left">
<label for="selectedID2"><a href="/editcourse.geo?id=2">Dev ILT 1</a>
</label>
</td>
<td align="Left"> ILT1 </td>
<td align="Left"> Instructor Led </td>
</tr>
<tr class="even">
<td align="center" valign="middle" class="">
<input type="checkbox" class="checkbox with-font" name="selectedID" id="selectedID1" value="1">
<label for="selectedID1"><span class="hidden"> 1</span> </label>
</td>
<td class="sorted" align="Left">
<label for="selectedID22507408476"><a href="/editcourse.geo?id=1">Dev UDT 1</a></label>
</td>
<td align="Left"> UDT1 </td>
<td align="Left"> User Defined Task </td>
</tr> '
</tbody>