Page 1 of 1
CSS VS tables
Posted: Fri Dec 09, 2005 10:25 am
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?
Posted: Fri Dec 09, 2005 10:36 am
by Nathaniel
That doesn't make sense. DIVs/CSS should almost always result in cleaner code - and less of it.
Posted: Fri Dec 09, 2005 10:46 am
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.
Posted: Fri Dec 09, 2005 11:13 am
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

Posted: Fri Dec 09, 2005 11:19 am
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.
Posted: Fri Dec 09, 2005 11:24 am
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

Posted: Fri Dec 09, 2005 11:26 am
by patrikG
ah, ok, I misunderstood you there. Makes perfect sense now.

Posted: Fri Dec 09, 2005 12:07 pm
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.
Re: CSS VS tables
Posted: Tue Dec 20, 2005 1:58 pm
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
