CreedFeed said:
Everyone keeps saying div tags load faster than tables... I just want to clarify, and correct me if I'm wrong, it's not that div tags just load faster than tables, it's the fact that less characters typed into an HTML document when using div tags... take for example a simple box with a border and the words Hello World!.
HTML:
<div class="greeting">Hello World!</div>
And it's table counterpart
HTML:
<table><tr><td class="greeting">Hello World!</td></tr></table>
And that's just bare bones table code. You would/could also specify cellpadding, cellspacing, borders, etc. right in the table tag. Now imagine a complex design using a table layout. Most table layouts require spacer images in order for designs to be placed in the appropriate areas on the screen. You can potentially cut the size of an HTML document in half using div tags over table tags. In the short term it may not seem like much, but if you're running a site that gets 1,000 unique visitors a day you'll notice a bandwidth savings in the long term.
I've used both and they both have definite pros and cons.
If somebody is having issues with tables, they may have similar issues with DIV tags. Tables are great because they force you to use a definite hierarchial structure (table, colsspan, rowspan, table nested within table, percentage of size etc.) but this too can be applied to DIV tags. I like tables because it fits in with the theoretical/practical topology of database data (again, that point too can be applied to DIV but its not as inherent)
As for cellpadding, spacing, borders and the like (or if you are on the current standard: border, border-spacing, and border-collapse) - there is little difference here between table & layout. You can save time & some space by using CSS for either/both tables and div, that should not be your reason for switching! Using CSS to define/encapsulate UI is also great for organization & essential for quick maintenance and/or when working in team (can't stand it when one developer puts attribute in CSS and the other inline, it's impossible to troubleshoot & maintain)
As for saving bandwidth or for 'speeding up load-time', that's a REALLY HARD SELL as your average HTML file is tiny, probably a fraction of the graphics displayed on the simplest site (i.e. so you take your html file from 9k to 8k, but your graphics are 35k per page)... It's a myth that spread around the 'net like fire and I don't get it: tables account for 5 to 10% of an html file so you are looking at a small fraction of the issue (graphics take up more space, they take longer to download, and longer to render onto the screen). As for .CSS, though it saves time in coding, maintenance and is good for organization I would not consider it a means of 'increasing speed' signifigantly as users browser is still quering it per html file.
I'm willing to be proven wrong here. Heck, I'm always looking for reason to learn something new... I have done some simple research on the topic and didn't find anything signifigant. You can also look at
http://www.decloak.com/Dev/CSSTables/CSS_Tables_02.aspx for more in depth info...
One place I use Divs and NOT Tables is for 'floating' selections that need to be quickly hidden/shown, as in
http://eeleaders.com/webmaster/, checkout the first page at that page and put cursor on the red tags.
Just my two and a half cents.
Not looking for a fight or flame war (why I have to say that is beyond me... These threads always end up getting catty... I don't own stock nor have any interest in the furtherance of neither divs nor tables... To each their own)