CSS VS tables

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

CSS VS tables

Post by s.dot »

Does a CSS layout take a considerable amount more time to load than say a layout with tables? The reason I ask is that one of my pages is purely a CSS layout using <div>'s and a stylesheet. After optimizing the PHP code in it I find that it still takes a while to load where as my pages using tables for layout loads considerably faster with more queries and php in it.

or... does my computer just suck?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
Nathaniel
Forum Contributor
Posts: 396
Joined: Wed Aug 31, 2005 5:58 pm
Location: Arkansas, USA

Post by Nathaniel »

That doesn't make sense. DIVs/CSS should almost always result in cleaner code - and less of it.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

but it seems to be more resource hungry on my end when I view it. =/ I don't know. Maybe my php isn't optimized as well as I think it is.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Tables render slower than CSS based layouts.
Tables are harder for screen readers to read than CSS based layouts.
CSS based layouts *can* use less bandwidth (with well-structured stylesheets)

If it really is because you're using CSS the only thing I could think of is lots of repeated inline CSS making the page size larger and therefore the bandwidth use higher. Can't think of anything else :)
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

d11wtq wrote:Tables are harder for screen readers to read than CSS based layouts.
That's interesting. Why is that?
I tried to think of a reason why that would be, but nothing comes to mind.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

patrikG wrote:
d11wtq wrote:Tables are harder for screen readers to read than CSS based layouts.
That's interesting. Why is that?
I tried to think of a reason why that would be, but nothing comes to mind.
I worded that badly. What I should have said was using tables makes it harder for people who use screen readers to read your content.

Now that I can give a reason as to why :)

CSS based layouts are almost always cleaner and if you view the source code you can practically read the material in the order it flows on the page itself....

The source code used in tables in somewhat more randomly ordered. That said.... you can write bad CSS and have everything structured in a complete mess.

I personally make a point of laying my CSS source out so that the textual content flows the way it does on the page when rendered :)
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

ah, ok, I misunderstood you there. Makes perfect sense now. :)
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

scrotaye wrote:but it seems to be more resource hungry on my end when I view it. =/ I don't know. Maybe my php isn't optimized as well as I think it is.
I think you stumbled onto your answer. I suspect its not the output that is the source of the slowdown - its probably the process to create it.

Try taking the output, saving it as a seperate file, and compare it to similar output with tables, saved as a seperate file. ie, take php out of the equation. I'd be willing to bet that the css site is faster or at least close to the tables page. Then you'd know it was something in the php code causing the resource concern, and we could work to help you improve it.

Also, if by some odd chance you find that interesting exception to the rule where the css style version is honestly larger (and I definitely think its possible), then share it, and we can see if there are areas of improvement possible.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: CSS VS tables

Post by alex.barylski »

scrotaye wrote:Does a CSS layout take a considerable amount more time to load than say a layout with tables? The reason I ask is that one of my pages is purely a CSS layout using <div>'s and a stylesheet. After optimizing the PHP code in it I find that it still takes a while to load where as my pages using tables for layout loads considerably faster with more queries and php in it.

or... does my computer just suck?
Thats impossible...your missing something...

Tables require a tremendous amount of recursion to render 100%...whereas CSS is pretty striaght forward...

look into it again :)
Post Reply