Click here to view the image这就是读取蓝色标记区域后发生的事情,红色标记区域是NVDA语音查看器之后没有任何内容,其中读取的内容正在被读取。我有一个非空表,但当与Firefox浏览器一起使用时,NVDA屏幕阅读器不会读取内容。它读取表格之前的所有其他内容。下面是弹出对话框中显示的示例代码。不想使用role =“presentation”,因为这样可以解决不读表的问题,但是屏幕阅读器读取的内容就像纯文本而不是表格一样。
<div role="dialog">
<h2>This is a H2 content. </h2>
<p>This is a paragraph</p>
<table style="width: 80%;">
<caption class="offscreen">this is the caption for the table.</caption>
<thead>
<tr>
<th style="width: 25%" scope="col">First Header</th>
<th scope="col">Second Header</th>
</tr>
</thead>
<tbody>
<tr><td>C11</td><td>C21</td></tr>
<tr><td>C21</td><td>C22</td></tr>
<tr><td>C31</td><td>C32</td></tr>
<tr><td>C41</td><td>C42</td></tr>
<tr><td>C51</td><td>C52</td></tr>
</tbody>
</table>
</div>