Why <table> is not good for layout while <div> is? for screen reader users

岁酱吖の 提交于 2019-12-23 17:14:34

问题


What is the problem with <table> tag which is not with <div> for screen reader users? Please Explain with example.


回答1:


I guess because you can communicate a proper table via audio, but can not parse a table used for layout and speak it sensibly.

Example

Title | Age
Bob   | 6
Greg  | 10

This can be spoken.

But what about this?

[img] | Welcome to my site | [img]
News  | [img] 

How do you think that would be read to a visually impaired person?

It all comes down to semantics. A table used for layout purposes can't be parsed and read correctly (or reliably). A div is just a division in a page, not necessarily for layout. I don't think screen readers give any semantic meaning to a div when speaking a page's content.

Many sites still use tables for layout. I suspect it will become less and less as less CSS capable browsers decline in share (IE6 for one).

Also, certain government sites must be accessible to everyone. This is Section 508. Using tables for layout will probably violate this.

If you want to have an idea of what a screen reader may read, check out Fangs for Firefox (reference to the screen reader JAWS).



来源:https://stackoverflow.com/questions/2399530/why-table-is-not-good-for-layout-while-div-is-for-screen-reader-users

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!