Why do the vast majority of pages till seem to use tables for layout?

Status
Not open for further replies.

Locut0s

Lifer
Nov 28, 2001
22,205
44
91
Been a long time since I did any HTML/Javascript coding and I want t get back into it. I was browing some HTML and javascript references. Refamiliarizing myself with the DOM and everythiung. So one way I thought would be to view a number of sites and just read through the code till it all came back to me. I notice though that most sites are still using Tables for layout. Wasn't this all supposed to dissapear with CSS and the box model etc etc etc....? I can understand using tables for things like displaying threads as that fits the content but not for the general layout. It seems so... 1995.

Does a large part of this stem from top down photoshop type design. E.G. lay it out in a layout manager then cut down to the tables and other elements. I can still see this being a good way to lay out a site but when it comes to implementing it they shouldn't use tables any more.
 

IronWing

No Lifer
Jul 20, 2001
72,923
34,081
136
Tables are easy, they work, and there is free web development software that cranks them out for web pages as simply as creating them in a word processor. Until tables are no longer supported, people will use them. Yes, you have more control and easier updates with CSS (if you do it right) but the learning curve is steeper before you can do anything useful.
 

Locut0s

Lifer
Nov 28, 2001
22,205
44
91
Tables are easy, they work, and there is free web development software that cranks them out for web pages as simply as creating them in a word processor. Until tables are no longer supported, people will use them. Yes, you have more control and easier updates with CSS (if you do it right) but the learning curve is steeper before you can do anything useful.

I don't see the learning curve as any more difficult really. I never got to the point where I was doing any more than writing my own web pages for fun, selft taught and never did any work. I first learned the now depresiated method of designing web pages then eagerly jumped on the CSS bandwagon. Shortly after that I stopped doing anything HTML related so it's not like I have any real experience but if anything I think CSS may be easier to use for page layout than tables. Certainly it makes reading the code much easier to understand.
 

Kalmah

Diamond Member
Oct 2, 2003
3,692
1
76
CSS doesn't always do what I tell it to do. In Firefox an element set to be at a specific px from the left will be in the correct spot.. load up IE and it's to the far right. So then you have to add javascript hooks or whatever else.

Tables are where you put them.. always.

But, sites in CSS usually tend to look tidier and better organized.

I'd like to use all CSS.. I'm just too lazy to dig into the tricks for it.
 

Locut0s

Lifer
Nov 28, 2001
22,205
44
91
CSS doesn't always do what I tell it to do. In Firefox an element set to be at a specific px from the left will be in the correct spot.. load up IE and it's to the far right. So then you have to add javascript hooks or whatever else.

Tables are where you put them.. always.

But, sites in CSS usually tend to look tidier and better organized.

I'd like to use all CSS.. I'm just too lazy to dig into the tricks for it.

Sadly a lot of the is IEs fault as usual. If you go look at CSS tutorials they will often say things like "this is the standard and works in all browsers except IE for which you have to use the following tweak".... In my experience though even tables had their quirks. It's just a matter of learning them.
 

Locut0s

Lifer
Nov 28, 2001
22,205
44
91
CSS doesn't always do what I tell it to do. In Firefox an element set to be at a specific px from the left will be in the correct spot.. load up IE and it's to the far right. So then you have to add javascript hooks or whatever else.

Tables are where you put them.. always.

But, sites in CSS usually tend to look tidier and better organized.

I'd like to use all CSS.. I'm just too lazy to dig into the tricks for it.

You are using a DocType declaration right?
 

Kalmah

Diamond Member
Oct 2, 2003
3,692
1
76
You are using a DocType declaration right?

Maybe that's my problem? I've made it a habit to use xhtml as the doctype. Probably because I took an xhtml class at one point. I remember having an issue once where after pulling my hair out for hours changing the doc type to html4.0 fixed it.

I don't think I ever fully understood the point behind doctypes.
 

Locut0s

Lifer
Nov 28, 2001
22,205
44
91
Maybe that's my problem? I've made it a habit to use xhtml as the doctype. Probably because I took an xhtml class at one point. I remember having an issue once where after pulling my hair out for hours changing the doc type to html4.0 fixed it.

I don't think I ever fully understood the point behind doctypes.

Doctypes tell the browser, web crawling bot, software parser or human reader what type of document to expect. That way they know without looking at the tags and the content how to parse it. An XHTML DocType should work no problem though. IE has a lot of stupid quirks and is WAYY to lax in it's handling of standards. I was referring specifically to this:

http://www.w3schools.com/css/css_boxmodel.asp

Browsers Compatibility Issue
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
Fact: 50% of designers and programmers are below average. That is why you will still see bad habits being done professionally.
 

her209

No Lifer
Oct 11, 2000
56,336
11
0
CSS doesn't always do what I tell it to do. In Firefox an element set to be at a specific px from the left will be in the correct spot.. load up IE and it's to the far right. So then you have to add javascript hooks or whatever else.

Tables are where you put them.. always.

But, sites in CSS usually tend to look tidier and better organized.

I'd like to use all CSS.. I'm just too lazy to dig into the tricks for it.
THIS!!!!! Fucking THIS!!!
 

xanis

Lifer
Sep 11, 2005
17,571
8
0
CSS doesn't always do what I tell it to do. In Firefox an element set to be at a specific px from the left will be in the correct spot.. load up IE and it's to the far right. So then you have to add javascript hooks or whatever else.

Tables are where you put them.. always.

But, sites in CSS usually tend to look tidier and better organized.

I'd like to use all CSS.. I'm just too lazy to dig into the tricks for it.

You need some Blueprint Framework in your life. It has all the CSS you need. It also has specific CSS files for IE that you add via an "if" statement in the head of the HTML. Works like a charm. All you need to do to adjust sizes of sections is change out spans (which are already defined).
 

SagaLore

Elite Member
Dec 18, 2001
24,036
21
81
In order to make CSS+DIVs work right in all standard browsers, you have to do some weird tricks. By the time you're done, its just as complicated and buggy as laying everything out in tables.

CSS+TABLEs is still pretty easy to do.

What we really need it an in-between. A new box like tag.
 

Red Squirrel

No Lifer
May 24, 2003
70,641
13,821
126
www.anyf.ca
Tables are easier to deal with and "flow" better with dynamic data. Take a forum for example, imagine trying to use only divs and spans for the topic listing and such? It would be a nightmare to code that. You'd have to guess how much space the text (dynamic) needs and size your x/y correctly etc.. Tables are much easier. They are also more compatible. IE sucks at CSS, it does not support most elements that are needed for tableless layouts. For a very simplified site I can maybe see it being better, or to add to the header/footer as you can position stuff more precisely, but for a full site, it's not worth the effort imo.

And using if statement stuff just to support other browsers is messy imo. It makes the code too hard to maintain for nothing as now when you want to make a change you have to do it a bunch of times. I also hate when a site requires JS to be enabled just to view it. Stick to basic html/css and it's way better.

I usually prefer using tables with css. You can still apply global formatting. What sucks is IE, again, is crap with CSS so certain things like border spacing, padding etc don't work in IE when you use CSS. I often just give up and don't support IE, but it sucks that there is still like 90% of the population using that crappy POS browser.
 

alkemyst

No Lifer
Feb 13, 2001
83,769
19
81
I don't see the learning curve as any more difficult really. I never got to the point where I was doing any more than writing my own web pages for fun, selft taught and never did any work. I first learned the now depresiated method of designing web pages then eagerly jumped on the CSS bandwagon. Shortly after that I stopped doing anything HTML related so it's not like I have any real experience but if anything I think CSS may be easier to use for page layout than tables. Certainly it makes reading the code much easier to understand.

stick your pinky out when you say these things...makes you cooler.

you code guru you.
 
Status
Not open for further replies.