Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 346
Jitendra Vyas Avatar asked Jan 21 '26 18:01

Jitendra Vyas


1 Answers

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).

like image 104
alex Avatar answered Jan 23 '26 06:01

alex



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!