Page 1 of 3

TABLE vs CSS

Posted: Thu Dec 15, 2005 10:35 pm
by alex.barylski
Just posted a question in Client Side in regards to CSS conversion from TABLE to CSS...

Made me think...

Do you really think CSS will replace TABLES when it comes to rendering complex interfaces/layouts???

I really like tables...even though I have before encountered limitations...maybe it was a bug in IE...not sure...never checked in FF :)

Anyways...

If you think about it...TABLES are IDEAL...for 2 reasons:
1) WYSIWYG editors understand them
2) The css knowledge I do contain suggests that reading the structure of a table in HTML format makes slightly more sense than CSS equivleant???

Again just my opinion :)

I'm thinking HTML just a more human readble pattern...unless I"m missing something about CSS...

In CSS wouldn't you render a table of say...3 columns and 4 rows...each with a ANCHOR surrounding a IMAGE...

Wouldn't you wrap the ANCHOR/IMAGE in a DIV regardless of where they reside and just set the css width/height/top/left to position the thing relative???

Get what i'm asking?

As CSS grows in popularity or stops where it is...do you think TABLES and CSS will always coexist???

Cheers :)

Posted: Fri Dec 16, 2005 12:03 am
by Gambler
CSS sucks at positioning. I would never ever thought of using it for layouts, if not for all that table-bashing. It's mssing many vital features that would make it worthwhile. For example, there is no eay way to do this:

Code: Select all

######
#pic #  String A
#ture#  String B
######

Posted: Fri Dec 16, 2005 12:12 am
by alex.barylski
I agree it sucks, but maybe only because I only barely understand it???

I know enough to style my pages so it's easy to change font color, etc... :)

And thats it :)

Posted: Fri Dec 16, 2005 12:30 am
by m3mn0n
I think you should reference it as "divs" or "div layers" for the sake of the arguement because CSS can be used in tables too (just not in entirely the same way) =P

Posted: Fri Dec 16, 2005 12:58 am
by 187skillz
It seems the way to go if you wanna be considered as a good developer or should I say designer is CSS layout, you would not believe the amount of people that are claiming that's the best thing since whatever, I do find it to have a lot og bug, it seems like a harder way to do things, but they all swear by it and even me myself I'm gonna have to go the CSS way...table seems a lot better from the front end side of things.

Re: TABLE vs CSS

Posted: Fri Dec 16, 2005 1:29 am
by Roja
Hockey wrote:Do you really think CSS will replace TABLES when it comes to rendering complex interfaces/layouts???
I'd say it already has for most of the best developers.

Take a look around the CSS zen garden, and witness *hundreds* of incredibly complex interfaces and layouts - all done without a table. Entirely using simple divs and semantic html, each style is a new stylesheet and set of images. After you've seen about half of them (I have!), you quickly understand that the best designs on the planet don't need tables, and the developers doing those designs don't use tables (for layout).
Hockey wrote:I really like tables...even though I have before encountered limitations...maybe it was a bug in IE...not sure...never checked in FF :)
Tables offer control, easily. They fit the "chop and drop" mentality that comes from pixel-perfect layouts in Photoshop. It is fairly straightfoward, and you can grasp the design easily.

However, they have a number of problems. They assume the content size in certain sections wont change - which generally, it does. They are extremely inflexible, and usually require the developer to use a fixed font size to prevent the table "breaking" at the seams. That results in less usability. Tables render more slowly, generally take more code to accomplish the same task, cant be cached as easily, AND have more layout issues on nextgen devices like cellphones and PDA's.

Thats quite a hit just to get "easy layout" - especially when that layout is so limited.
Hockey wrote:1) WYSIWYG editors understand them
The latest versions of WYSIWYG editors understand css just as well. Dreamweaver, Frontpage, and NVU all handle css-based layout designs just fine in their latest versions.
Hockey wrote:2) The css knowledge I do contain suggests that reading the structure of a table in HTML format makes slightly more sense than CSS equivleant???
Thats accurate, but it also means the *contents* in that table makes *less* sense than the same in a solid semantic html page. Which is better? Search Engines read content in a linear fashion - so tables lose. Worse, tables rob the structure of semantic meaning - you can't do an h1 in the middle of a table. :)
Hockey wrote:I'm thinking HTML just a more human readble pattern...unless I"m missing something about CSS...
You definitely are missing something there. Well done html+css is far more readable than tables - if we are talking about content and structure. If you mean the layout itself, yes, CSS can take a little while to wrap your head around it.

Hockey wrote:As CSS grows in popularity or stops where it is...do you think TABLES and CSS will always coexist???
Its important to make a clean distinction here. Tables themselves are not evil. For displaying *tabular data*, tables are the right choice. Tables for LAYOUT, however, is non-ideal. Most high-end developers left tables for layout behind years ago.

Re: TABLE vs CSS

Posted: Fri Dec 16, 2005 1:40 am
by alex.barylski
Roja wrote:Its important to make a clean distinction here. Tables themselves are not evil. For displaying *tabular data*, tables are the right choice. Tables for LAYOUT, however, is non-ideal. Most high-end developers left tables for layout behind years ago.
Alright...you've convinced me with that single statement...

Not saying I'm gonna rush out and buy a book on CSS...personally...I hate doin anything with interface when developing PHP applications...I'd much rather work with a designer...but still it's an essential evil I guess to have an understanding of HTML/CSS as a developer :)

Thanks for the input...or is that output :P

Cheers :)

Posted: Fri Dec 16, 2005 4:15 am
by Grim...
I switched from tables to CSS about six months ago. It's hard, but stick at it, and you'll get there.

Posted: Fri Dec 16, 2005 4:54 am
by foobar
Gambler wrote:CSS sucks at positioning
http://www.csszengarden.com :roll:

Re: TABLE vs CSS

Posted: Fri Dec 16, 2005 5:30 am
by Grim...
Roja wrote:...Take a look around the CSS zen garden...
:roll:

Posted: Fri Dec 16, 2005 8:08 am
by Bill H
For example, there is no eay way to do this:
What you illustrated is actually quite easy in CSS by using "float:left" for the picture.

When I started getting into CSS for layout I thought it was a stupid system invented by idiots. But, then I thought the same thing about C when I started using it some 25 years ago and now I can write in that language (well, usually C++ now) faster than I can in English. (I don't recall what I thought about COBOL et al, that was too long ago.)

It just takes some time and patience. I've now gotten to where I vastly prefer CSS, although I admit that once in a while some layout defeats me in CSS and I say to heck with it and use a table.

Posted: Fri Dec 16, 2005 9:16 am
by Buddha443556
Bill H wrote:It just takes some time and patience. I've now gotten to where I vastly prefer CSS, although I admit that once in a while some layout defeats me in CSS and I say to heck with it and use a table.
Yep, me too.

I'd also rather use a TABLE than a CSS hack in a layout. I just see those CSS hacks as maintenance nightmares waiting to happen.

Posted: Fri Dec 16, 2005 2:04 pm
by Gambler
However, they have a number of problems. They assume the content size in certain sections wont change - which generally, it does. They are extremely inflexible, and usually require the developer to use a fixed font size to prevent the table "breaking" at the seams.
...also, they drink human blood and require sacrifices of newborn children.

Re: TABLE vs CSS

Posted: Fri Dec 16, 2005 2:11 pm
by Luke
Roja wrote:Take a look around the CSS zen garden, and witness *hundreds* of incredibly complex interfaces and layouts - all done without a table.
WOW! That completely made me rethink css layouts. Incredible.

Re: TABLE vs CSS

Posted: Fri Dec 16, 2005 2:26 pm
by Roja
The Ninja Space Goat wrote:
Roja wrote:Take a look around the CSS zen garden, and witness *hundreds* of incredibly complex interfaces and layouts - all done without a table.
WOW! That completely made me rethink css layouts. Incredible.
Yeah, that site (still) really blows me away.. they continue adding new designs, and it really does a fantastic job of showing the incredible range of possibilities. Even though I've been visiting essentially since it was launched, I never stop being amazed by some of the designs.