Is CSS an abuse of HTML?

Busy's picture

He has: 6,151 posts

Joined: May 2001

Been reading a few discussions by Table haters (CSS fans) and the thing I am seeing over and over again is that tables are not being used as they were designed for. Now I can argue this point and prove that a table layout is being used as intended (not talking a fancy image site), but got me thinking, CSS is heavily based around lists (HTML Lists), now lists were designed to list data, not to control a layout and/or structure of a site.

So really, who is abusing what? HTML abusing tables or CSS abusing lists?

Reading all these sites from so called experts, IMO tables were either to hard for them, or they weren't able to get technical enough with them. Trying to find old sites of these 'experts' that were done in HTML Strict is near impossible although they use XHTML Strict now.

dk01's picture

He has: 516 posts

Joined: Mar 2002

I think something to look at may be the fact that its easier for search engines to deal with lists than tables. I didn't mind tables but the nesting of tables IMO just got out of hand. You end up having to nest 3 tables just to get your layout set up sometimes. Hand coding it was just ugly. Sure it could be done properly but I found it to be a pain and a time waster. Some older browsers ironically choked on these nested tables but once the new versions came out with new css features were able to process many more nested tables. Kind of like fixed 2 problems but only really needed to fix one.

See Mark Newhouse's guide to Taming Lists in CSS for his view. Basically he claims that the majority of navigation just just a series of links. A series of links is just a list so it should be labelled as such. Why not use a table for this kind of design? Well because its not tabular data.

Here are some good resources regarding the subject:
http://www.evolt.org/article/Tables_or_CSS_Choosing_a_layout/25/21429/
http://www.alistapart.com/stories/tohell/
http://scriptingnews.userland.com/backissues/2002/02/13#areTablesReallyEvil
http://lists.evolt.org/archive/Week-of-Mon-20010827/056016.html

Overall no one is saying you have to switch. You just have to pick the lesser of two evils. If you find tables better than by all means stick with tables. These are after all only recommendations. Personally I see no harm in knowing both tabled and table-less design if it enhances my skillset. In the words of Jeffery Zeldman "We can watch our skills grow obsolete, or start learning standards-based techniques now". Whether tableless design is obsolete is a subjective view but one that I would consider and not pass off as impossible.

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

Well, the reason(s) why I choose not to use tables to layout my pages with tables anymore is that, it just makes more sense not to. I mean, when trying to debug I'd continually say things like "The navigation is what cell?!" "The content goes where?" etc.
And that's just working on the site, when I try coming back to the site after not touching it for a while, I get a headache.

More obviously though, it's only because I like my code to be clean, and I find that using DIVs and CSS is a lot cleaner (sometimes) than using TABLEs.

Busy's picture

He has: 6,151 posts

Joined: May 2001

Thanks for the links dk01 but those are some of the people I was talking about, and that zeldman fella is one of the worst of them. That quote "We can watch our skills grow obsolete, or start learning standards-based techniques now", Umm hello, tables are standards based, can even still use them in XHTML Strict. I think he spends to much time in front of the mirror (seen all the vanity sites)

Renegade, your code may be cleaner, but what say you work in a debt of designers, all doing CSS layouts and you have to edit one of your co workers work, sure he can understand #topbit and #nav_overthere but it would take you longer to learn his style and edit it than if was a tabled layout (just turn table borders on to find what where).

Anyways this is way off topic, topic is, Is CSS an abuse of HTML?
div is a suitable CSS tag, lists aren't, lists are HTML based for displaying listed data, not for layouts, and more and more layouts are built with lists.
I reckon in a few years there will be an outcry about this, like is now with tables. I bet a chocolate fish on it Wink

chrishirst's picture

He has: 379 posts

Joined: Apr 2005

Navigation menu layouts are being done with lists yes, but surely this would be semantically correct, as a menu is a list of
You can of course turn borders on for s as well using one edit with CSS if you wanted.

Chris

Indifference will be the downfall of mankind, but who cares?
Venue Capacity Monitoring
Code Samples

dk01's picture

He has: 516 posts

Joined: Mar 2002

Exactly Chris. Tables, are specifically for tabular data. And lists are for list data. Navigation is list data because its a list of links. Its not tabular. If you had a navigation grid of some sort then it would be fitting to use a table maybe. This however is not the case on the vast majority of websites.

I would like to see some examples of lists being abused though because I wouldn't want to be preaching against something unless I have concrete examples of it. I tried finding sites that rely too heavily on lists in their design but could not find any. Busy do you have some examples for us skeptics?

Busy's picture

He has: 6,151 posts

Joined: May 2001

quick look found this one off sitepoint tuts or w3schools, one or the other
http://somerandomdude.net/projects/webdev/divless/

Plenty around using DD, DL for layout, will post some more later (should of bookmarked them)

[edit] wasn't w3schools, they still use good ole tables Wink

teammatt3's picture

He has: 2,102 posts

Joined: Sep 2003

Quote: Is CSS an abuse of HTML?

Can you really "abuse" code? Who judges the purpose of code, and what it was meant to do? You can do whatever you want with code; just make sure it is in line with local and federal regulations Wink.

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

Busy wrote: CSS is heavily based around lists (HTML Lists), now lists were designed to list data, not to control a layout and/or structure of a site.

What???? CSS is not based around lists. That's rediculous. Lists are being used a lot more now that we are able to do more with the styling and can therefore use them for their rightful purpose A navigation menu IS a list. Definition lists are used to lay out things like form controls because those items can best be structured as lists. It's the most logical mark-up.

I do see what you mean by overuse of lists when looking at the somerandomdude link. Using a DL or UL for a full site strcuture is also rediculous Wink I've never came across that before though, and I do read the blogs of most of the top experts. That's not a mainstream technique at all.

Quote: Reading all these sites from so called experts, IMO tables were either to hard for them, or they weren't able to get technical enough with them. Trying to find old sites of these 'experts' that were done in HTML Strict is near impossible although they use XHTML Strict now.

This is also rediculous. So rediculous that there is no point in arguing with it!

Quote: That quote "We can watch our skills grow obsolete, or start learning standards-based techniques now",

Very true.

Quote: Umm hello, tables are standards based, can even still use them in XHTML Strict.

FOR TABULAR Data! NOT FOR LAYOUT!!! Whether something validates or not is only part of standards compliance. I belive Jeeves has read the spec and can quote the section that says not to use mark-up incorrectly. TABLES FOR LAYOUT IS INCORRECT!

My opinion is that anyone who continues to argue in favour of using tables for layout is someone who just can't be bothered to learn proper methods. And whines about it.

dk01's picture

He has: 516 posts

Joined: Mar 2002

Megan wrote: What???? CSS is not based around lists. That's rediculous. Lists are being used a lot more now that we are able to do more with the styling and can therefore use them for their rightful purpose A navigation menu IS a list. Definition lists are used to lay out things like form controls because those items can best be structured as lists. It's the most logical mark-up.

I do see what you mean by overuse of lists when looking at the somerandomdude link. Using a DL or UL for a full site strcuture is also rediculous Wink I've never came across that before though, and I do read the blogs of most of the top experts. That's not a mainstream technique at all.

This is also rediculous. So rediculous that there is no point in arguing with it!

Very true.

FOR TABULAR Data! NOT FOR LAYOUT!!! Whether something validates or not is only part of standards compliance. I belive Jeeves has read the spec and can quote the section that says not to use mark-up incorrectly. TABLES FOR LAYOUT IS INCORRECT!

My opinion is that anyone who continues to argue in favour of using tables for layout is someone who just can't be bothered to learn proper methods. And whines about it.

Busy's picture

He has: 6,151 posts

Joined: May 2001

Megan wrote: FOR TABULAR Data! NOT FOR LAYOUT!!! Whether something validates or not is only part of standards compliance. I believe Jeeves has read the spec and can quote the section that says not to use mark-up incorrectly. TABLES FOR LAYOUT IS INCORRECT!

Jeeves or Megan, please quote me the specs (pre '99 of course) that say tables is for tabular data ONLY. I believe that has only been introduced with XHTML.

Imagine this is a table:
________
|111|222|
---------
|333|444|
---------
Now imagine the top left cell (111) says Monday, 222 says Tuesday, and under that a number of the week (a very small calendar), now this IS valid tabular data - what tables were designed for right. Long story short, stick an image in 111, 222 and 333 and leave text in 444 we have ourselves a layout. Even back in HTML2 images were approved - still are.
So whats the difference? Nothing.
To use a tabled layout with XHTML Strict alignment is not allowed, but with CSS we can align anything, throw in some classes and you have a valid Strict page even though done wrong

Megan wrote: My opinion is that anyone who continues to argue in favour of using tables for layout is someone who just can't be bothered to learn proper methods. And whines about it.

See what I said first post Wink I use proper methods, trans and strict. As for whining, I'm no sheep. Just because some guy is able to write a book about CSS he becomes a guru? Some years back some HTML professor (think he was a professor) wrote a book about HTML, his word was gospel, he used caps and did a lot of things old school but he was a mentor to many of those 'gurus' today. he has advanced with the times but is no longer the favor of the month because CSS is the new thing.

This is all so funny, reminds me of area 51, walking on the moon, the 9/11 pentagon disaster...
This wasn't meant to be about tabled verses CSS, was about CSS abusing html tags. Strange how table haters (bit like ford vs Chev) always have to resort back to the tables issue.

Is CSS easier to learn? Probably (If you understand the principal behind the structure of tags, definitely is.). Faster to code? Sometimes. The only way to do things? No.
Keep an open mind ...

Spell check c/o google toolbar btw Laughing out loud
Season Greetings everyone

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.