简体   繁体   English

隐藏表列 header 中的某些部分

[英]Hide some part from the table column header

I have one table.我有一张桌子。 In table column I have two thing one table column name and one icon to sort column.在表格列中,我有两件事,一个是表格列名称,一个是用于对列进行排序的图标。 Everything works fine, but right now I started working with accessibility and found that for each column value it reads both table header and aria label for icon also.一切正常,但现在我开始使用可访问性,发现对于每个列值,它都会读取表 header 和 aria label 图标。 I don't want read aria label for icon Is there any way to give label for icon so that it read in screen reader but don't read foe each data row.dont want to put icon outside of table column also.我不想读取图标的 aria label 是否有任何方法可以为图标提供 label,以便它在屏幕阅读器中读取但不读取每个数据行。也不想将图标放在表列之外。

Use the solution as explained here in Sortable Table .使用可排序表中说明的解决方案。

  • Use aria-hidden to remove the icon from accessibility and also使用aria-hidden从可访问性中删除图标,也
  • Use aria-sort which meets the arrow icon purpose and lets the Screen Reader know the direction of the sort: ascending or descending.使用符合箭头图标目的的aria-sort并让屏幕阅读器知道排序的方向:升序或降序。

Visual users would be able to know the direction by seeing the arrow icon position.视觉用户可以通过看到箭头图标 position 来了解方向。

Non-visual users would be able to know when SR speaks the aria-sort value.非视觉用户将能够知道 SR 何时说出aria-sort值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM