In HTML,tables are not used,ins ted we use div.Why we are using divs instead of tables?

Public Comments

  1. Tables are never to be used for page layouts. Only the lazy and ones who don't know how to properly layout a page with DIVs and CSS use tables. You use tables only when presenting tabular data on your pages. Ron
  2. Divs provide quite a bit more flexibility. Aside from that, tables are meant for, well, tabular data. When they get forced into layout design, things get ugly. You'll notice that a tabular design has lots and lots more code than one with divs. This makes it a lot less readable for the coder. Also, divs can be placed anywhere. You can have your menu div be first in the code, then the content, even if the content appears to the left of the menu in the actual page. This provides for better accessibility for people who use screenreaders - those who are visually impaired, who number far more than you think. See sources for a site that has one (1) html file, and designers submit css files and images to completely change the look. It wouldn't be possible with tables.
  3. I'm sad to say this but tables are not as good (even though I tend to end up using tables). I ran into this issue while making a skin for Wordpress. Originally I thought my skin would be relatively "tabular" and then it ended up not. It's a pain in the arse to fix the alignment of table cells. 1. it's easier to align with div's 2. you have more flexibility 3. it's easier to read ------ the advantages of using a table, however... 1. it's easy to write and fast 2. older browsers will be able to read them properly
Powered by Yahoo! Answers