PDA

View Full Version : table layouts forever?


jfb
09-07-2007, 12:13 AM
I have been lead to believe that tables for page layout is a bad thing. And I assumed that tables for page layout would fade away with HTML 4.01, XHTML and CSS . But that does not seem to be the case. Everyday I see XHTML sites that use <div> tags and CSS as a means to layout the pages with tables. Everyday I see questions on this forum concerning how to use CSS to set up a table layout; and they get answered. What's more, those table layed-out pages look good and get validated. Even this forum is set up with tables! So I guess my question is this: should I/we really make an effort to abandon something (tables for page layout) that appairently is going to be around forever? Or should I/we not accept and use tables for layout, knowing that the end product is what most people expect to see anyway?..

If I knew how, I would make a poll out of this question...

Horus_Kol
09-07-2007, 04:35 AM
what we have here is a form of inertia...
the web as we have it has been around about 20 years now... you can still find sites that haven't been changed in 5 or even 10 years out there...
and for many of those years, the most published web content were tutorials on how to make a web page (at least, after illegal and adult content)...

so, when you search on how to setup a page - you're likely to pull up something that is in serious need of an update...

add to that - there are many books that were written in the last 10 years and are still moving off the shelves, and they had tutorials which produced code that worked most of the time in most of the browsers - remember CSS1 wasn't (isn't?) fully supported by IE5 and early IE6... CSS2 still isn't fully supported by any browser (as near as I can tell - although most are 95% there).

Add to that, tables are relatively conceptually easy, while the box models of IE and FF make <div> behaviour quirky to the uninitiated.

So, what we have is perpetuation of old skills where beginners are introduced to tables first - although some publications and web tutorials do make an effort to introduce proper <div> and CSS positioning later on (and some bypass table structures completely - but this is a relatively small number) - so most people learn who to make a good looking page in tables and stay at that point...

And the final issue - posting a website up on the internet is not technically or economically difficult - literally anyone with notepad, internet access, and a few simple instructions can post a page/site...

Okay - all that addresses the whys of tables being predominant on the internet...

now, whether we should keep using tables and stop promoting <div> layouts?
Never - <div> layouts are, ultimately, easier to modify (both structure and style) - they are faster to render - and, in this day and age of semantic markup - using a <div> layout means that a <table> has meaning...

dimeric
09-11-2007, 05:42 AM
Part of the reason is cost, places like amazon, play, ebay etc are far more concerned with making websites that can be viewed by all browsers, and are easy to write (lets face it tables are just easier to use than css and divs, also you dont need to test them in every browser).

Also lots of large scale websites are created by complicated backend systems that were made a while back and output tables, changing this is not necassarily a simple thing todo as the program flow may have to be changed (swap a 4x4 grid from tables to divs and you have to change the output flow from rows to columns if you see what i mean).

Finally at the end of the day, how many people refuse to buy books off amazon.co.uk because it uses tables for layout, but i bet a load of people would stop buying books if they didn't use tables but the layout started screwing up on safari etc.

Sedativechunk
09-11-2007, 04:24 PM
Part of the reason is cost, places like amazon, play, ebay etc are far more concerned with making websites that can be viewed by all browsers, and are easy to write (lets face it tables are just easier to use than css and divs, also you dont need to test them in every browser).

Me and another guy I know who has been coding for around 10 years got into a debate about this. Is is a good thing to use DIV's for layout controlled by CSS? Yes. Is it good to use table's for layout to get the look you need? yes.
Sure, there are standards, faster loading times, structured markup, and "rules to the web", but tables for layout (sadly) is, and most likely is going to be the best way to create a website for (at least) another 5 years (maybe more maybe less). Lets look at the facts:

There are still more people using IE then Firefox.
There are still people using IE4 and even older web browsers to view sites.
IE is still going to go by their own standards and probably will never care much for CSS layouts.
Many people are still using old school monitors with limited color capabilities to handle multicolored CSS layouts.

Go look up the facts yourself. There are tons of people across the web that don't even have a "modern" PC with a new version of IE. And even with my sites, I work very hard to make a good 3 column layout to work in IE7 only to see everything is out of hand and the footer is randomly placed in the corner in IE6.

Personally, I think ALL the web based problems in the world would be wiped out if everyone quit using IE and Mozilla came pre-installed on new computers. Other than that, average older American's don't even know there is another web browser! I hate having to worry about this fact, and for that, life would be easier if I went with a table layout, but I see CSS as being much more controllable.