Log in

View Full Version : Div or Tables



richardray
07-09-2011, 04:04 PM
Which elements of HTML either Div or Tables should be used while designing a webpage.

jscheuer1
07-09-2011, 05:10 PM
Tables are for tabular data - like a menu, price list, games and scores, officers and their titles, that sort of thing.


Content like images, and text go in div or p.


There are also lists (ul or ol with li's) for things you may want to itemize, like this list in this post.


There are times when you may want to bend these guidelines, generally that's OK. It's good to avoid tables where there's non-text content unless the dimensions of all items including the table and its cells are spelled out explicitly because not doing so can make the page load in odd ways and take longer to load. Nesting tables is similar. If it's all text content, it generally doesn't matter so much.

There are also other elements. Each is suited to particular kinds of content.

djr33
07-09-2011, 08:35 PM
For layout, use divs positioned with CSS. For specific kinds of data/content that fits well in a table, use a table.

DuncanCox
07-15-2011, 05:22 AM
I also agree div use only in case of CSS and for data use table.