问题
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