|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
SitePoint Articles
Join Date: Apr 2001
Posts: 0
|
Discussion thread for Tables Vs. CSS - A Fight to the Death
This is a dedicated thread for discussing the SitePoint article 'Tables Vs. CSS - A Fight to the Death'
|
|
|
|
|
|
#2 |
|
Non-Member
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jan 2004
Location: Melbourne, Australia
Posts: 8,131
|
Hmm. The Article title is pretty misleading, considering you can't compare, or replace tables with css.
|
|
|
|
|
|
#3 | |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Feb 2003
Location: UK
Posts: 225
|
Quote:
|
|
|
|
|
|
|
#4 | |
|
CSS Advisor
![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 26,615
|
Hi,
Quote:
Code:
#membership, #sightings {
width: 415px;
padding: 0px;
margin: 0 5px 0 215px;
}
![]() I could do that whole layout in about 30 minutes in CSS without using a bg gif either. (It would take me about 2 weeks with tables lol - because I'm useless with tables). I expect someone fluent with tables could do it just as quick also. I see no right and wrong way - just what's right for the job in hand. Of course the w3c recommends not using tables for layout but you can make tables more accessible with a bit of thought. My preference is to code in css because thats what I do best but if a client says that he wants the layout to look good in NN4 then I'd either talk him out of it or revert back to a table if there was no other solution. Some things suit tables and some things suit css, you just have to decide whats best for the job in hand and takeing into account any other issues such as accessibility/usability etc. I think the article was interesting and raised some interesting points but Id rather get away from the tables versus css standpoint as it only seems to cloud the issue. It's like comparing chalk and cheese ![]() Paul |
|
|
|
|
|
|
#5 |
|
runat="server"
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Nov 2001
Location: Colorado
Posts: 2,113
|
one thing is certain, the future of design/layout is CSS. Like all paradigm shifts, it takes time, some will move faster than others to adopt. But as CSS3 rolls out and browsers streamline others will get on board.
|
|
|
|
|
|
#6 |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Oct 2000
Posts: 1,709
|
I think it was a great article and basically it makes me even happier with my current choice - mixing tables and CSS. I use CSS where I can to position elements more accurately and save on code and of course for buttons, text etc. However, I do still use tables for layouts, when I want to get greater browser compatibility without having to spend too much time figuring out the different css "hacks". I use one external CSS sheet for every site and I also often use PHP templates that allow me to keep the "design part" seperate from the actual "content". That way, my content pages are very slim and have nothing but content and <h1> and <p> tags etc. If I ever wish to move to a totally CSS based design, I already have content seperate from design.
Why not pure CSS? because I don't have the time and energy to validate it on the various browsers and work out the hacks. I'm used to working with tables for layouts so it's simply faster that way. |
|
|
|
|
|
#7 |
|
Back in Action
![]() ![]() ![]() ![]() ![]() Join Date: Jun 2001
Location: outside my mind
Posts: 964
|
I don't like this article too much.
Why didn't he use CSS in the table layout to control padding and rollovers? There is not a stated rule that you CAN'T use CSS when working with a table layout. He's comparing 2000 markup techniques with modern ones. What he should of done was compare CSS with Tables to CSS without tables. I agree with ow1n's comment too. The author does not try and achive any sort of complicated design with the sites, one of tables strong points. He designed a site that would work well with CSS not something fancy and complicated like wired.com. |
|
|
|
|
|
#8 | |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Nov 2001
Location: Bath, UK
Posts: 2,532
|
Quote:
Douglas |
|
|
|
|
|
|
#9 | |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Nov 2003
Location: Malmoe, Sweden
Posts: 265
|
Quote:
Wired.com is: "Look ma, no tables" |
|
|
|
|
|
|
#10 |
|
SitePoint Member
Join Date: Jun 2004
Location: Guadalajara, Jalisco
Posts: 7
|
Answers
Ok, I'm late to the fray, since I was unaware of this topic (I thought I was going to get a notice or something). Some answers:
I'm glad the article had a warm reception. It is not meant to be an end-all be-all of the whole Tables vs. CSS debacle. It's a case study, and I had a lot of fun writing it. |
|
|
|
|
|
#11 |
|
SitePoint Enthusiast
![]() Join Date: Jan 2004
Location: NYC
Posts: 28
|
You can look at the market leading websites like Amazon, Yahoo, Ebay, Google, etc. What they all have in common..
1) They all use HTML tables. 2) They all look fine in all browsers.. down to even non-CSS browsers like Netscape 3.0. CSS produces inconsistent results across different platforms and browsers. You can just look at CSS forums around the internet, and you'll see experienced coders struggling with cross-browser issues. With HTML tables, it's easy to make webpages that will look good in virtually ANY browser. You never know what someone might be using.. Opera on Mac, Safari, a PDA on GPRS, proprietary web terminal at an airport/internet cafe, old versions of IE or Netscape, whatever. It's ok to use CSS for minor effects like removing underlines from some links, or the occassional hover effect. But your website shouldn't "blow up" if CSS fails for the visitor. You shouldn't RELY on CSS. 1997: "Push technology will make browsers obsolete". Nope. 1999: "All websites will be designed in Flash". Nope. 2000: "WAP/WML is the future". Nope. 2004: "Pure-CSS, tableless designs will replace HTML tables". Nope. Looking at the successful, market leading websites - like Amazon, Yahoo, Ebay, Google - they all have followed a similar strategy of keeping it simple, functional, and making sure their websites look ok to 99.999% of internet users. And with that strategy, they beat their competitors. After all, Boo.com had an exciting, "cutting edge" website, but we all know what happened to them. Looking at real world results - not idealistic theory - and you'll see HTML tables are the clear winner. If you care about winning, then you should focus on having a simple, functional, HTML table-based website that looks good to 99.999% of internet users.. the strategy used by the billion dollar market leaders like Amazon, Yahoo, Ebay, Google. If you don't care about winning, but want a beautiful cutting edge site, then build something like CSSzengarden. Last edited by normaldude; May 29, 2004 at 13:54. |
|
|
|
|
|
#12 |
|
Ceci n'est pas Zoef
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Nov 2002
Location: Malta
Posts: 1,120
|
<fact>
There's already rather a few 'big' CSS based sites, but it's been dripping rather then pooring. </fact> <speculation> I'm thinking a lot of companies are working behind the scenes on a CSS redesign but are holding of implementation untill they see what Longhorn's browser will be like. I have this feeling that if it is fairly standard compliant the floodgates of CSS will be opened. </speculation> That's what I might do if I were a well paid corporate manager scared to screw things up anyhow (*). Rik (*) Unfortunately I am not. |
|
|
|
|
|
#13 | |
|
CSS Advisor
![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 26,615
|
Quote:
![]() http://www.pmob.co.uk/temp/3column_simple_1.htm http://www.pmob.co.uk/temp/2column_simple_1.htm http://www.pmob.co.uk/temp/2column_simple_table2.htm Paul |
|
|
|
|
|
|
#14 |
|
SitePoint Zealot
![]() ![]() Join Date: Apr 2003
Location: New Zealand
Posts: 107
|
One of the major selling points of CSS is the separation of content from layout/design. Based on many people's comments, I understand this to mean that regardless of what is within the <body></body> section, the layout/design can be modified simply by altering the stylesheet rather than going through every file to make the changes.
This is certainly true when it comes to styling. Even without plastering the file with class tags, the cascading nature of CSS can be used to apply styling to the text. The style can then be easily changed simply by changing the stylesheet. While this is certainly true for fonts, coloring, and even margins and padding, I wonder just how great a change could be rendered in the layout of multicolumn CSS based sites without changing some DIV tags in the body. For example changing from a 2 column to a three column layout with the exact same content, just positioned in different places. |
|
|
|
|
|
#15 | |
|
Ceci n'est pas Zoef
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Nov 2002
Location: Malta
Posts: 1,120
|
Quote:
However, if your site has a proper 'semantic' structure which contains a 'number of identified parts' it will be possible to rearrange those 'parts' without touching the html. Must link to this once more: http://www.csszengarden.com/ Rik Last edited by Zoef; Jun 2, 2004 at 10:49. |
|
|
|
|
|
|
#16 |
|
Non-Member
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jan 2004
Location: Melbourne, Australia
Posts: 8,131
|
Overcaff,
I was referring to the Title. Tables can be replaced with other elements styled with CSS but not css on it's own. I know I know, I'm too picky![]() |
|
|
|
|
|
#18 |
|
SitePoint Evangelist
![]() ![]() ![]() ![]() Join Date: Feb 2003
Location: Somewhere in, MD
Posts: 404
|
Here is what i am curious about...
I use tables to display data sometimes up to 12 -15 columns. Would it make sense to use CSS in this case or just stick with the tables? |
|
|
|
|
|
#19 | |
|
SitePoint Member
Join Date: Jun 2004
Location: Guadalajara, Jalisco
Posts: 7
|
Quote:
|
|
|
|
|
|
|
#20 | |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Nov 2001
Location: Bath, UK
Posts: 2,532
|
Quote:
The question people are asking is: "Should I use Tables or CSS?" Superfically it makes sence when you are talking about layout: Should I position things with a table, or should I position them with CSS? "Tables" are things made of HTML tags, which look like this: <tag attribute="value"> "CSS" are things which look like this: selector { property: value; } What makes the question above wrong, is that in a "CSS" thing, the selector always selects an "HTML" thing, normally a tag. That means that if you use CSS, you have to have some "HTML" thing to select. CSS can't exist by itself. That means that the question really is: "What should the CSS select?" Well, what should it select? What HTML should someone use? That's the w3c's job: to tell people which tag is the best for which job. So, when Joe asks "use CSS or tables" we have to look at what we could replace the tables with; in the HTML. We've got lots of tags to pick from. The ones brought up so far would be the unordered list, <ul>, and the division, <div>. Three otions then, because we are wondering whether we should use tables or not. Here are what the w3c says we should use these tags for: <div> - the division: A generic mechanism for adding structure to documents. <ul> - the unordered list: A list of one or more list elements. <table> - the table: Allows authors to arrange data into rows and columns of cells. So that is really it. If you don't want your blocks to mean anything, use the generic division. If you want to make a one dimensional list, use a list. If your data is in rows and columns, use a table. Whichever option you take, you'll probably want to use CSS to style it. The only question after that is: "what do you want to style?" "Display data in 12 -15 columns?" Sounds like rows and columns to me, go use a table. Regards, Douglas |
|
|
|
|
|
|
#21 |
|
CSS Advisor
![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 26,615
|
Good answer Doug
![]() |
|
|
|
|
|
#22 | ||
|
Drupaler
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jul 2002
Location: London, UK
Posts: 3,299
|
Quote:
Quote:
![]() |
||
|
|
|
|
|
#23 | ||
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jan 2004
Location: Kentucky, USA
Posts: 1,091
|
Quote:
Quote:
Sorry if I'm being picky, but I thought it was worth mentioning to avoid arguments over bad definitions ![]() |
||
|
|
|
|
|
#24 | ||
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Nov 2001
Location: Bath, UK
Posts: 2,532
|
Quote:
![]() Quoting some more though: Quote:
|
||
|
|
|
|
|
#25 | |
|
CSS Advisor
![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 26,615
|
Quote:
![]() |
|
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 03:39.













Hybrid Mode
