SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: css vs tables

  1. #1
    SitePoint Member
    Join Date
    Aug 2004
    Location
    KENT, UK
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    css vs tables

    I am very keen to use css for all my developments, but I have found so much debate as to whether css can implement pure columns that I wonder what people are really implementing on live sites.

    This may be sacrilege, but is it true to say that most people are still using tables for pages where columns are required, but using css for everything else? (Having 'viewed source' for many live websites, this is my conclusion...)

    PLease feel free to totally pull me apart on this one - I would just like to know what the real World is doing before I make a fool of myself using ideals which don't work across all platforms. (Personally, I WANT to use pure css but have got this niggling worry...)

    Many thanks

  2. #2
    Non-Member Egor's Avatar
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    7,305
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Use what's best for the job. Simple as that.

    You can't compare CSS to tables. You can compare tables to no tables.


    What has got you worried? You really shouldn't be making desicions from other peoples perspectives.

    It is true that a fair bit of people design using tables, and there's nothing wrong with that. There's also a lot of people that find designing without tables easier (being one myself).

    Div's also weren't made to act like auto stretching table cells. That's what talbes are for.

  3. #3
    SitePoint Member
    Join Date
    Aug 2004
    Location
    KENT, UK
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was not trying to compare css and tables.

    My question stems from tying to find out how to successfully implement a 3-column display using css. I have read various articles (eg; http://css-discuss.incutio.com/?page=ThreeColumnLayouts) and there seems to be a huge amount of discussion as to what works/doesn't work on various platforms and lots of workarounds needed. I am quite happy to adopt such solutions, but at the same time, have not seen a lot of this within live web sites. Does that mean that people are still using tables to do 3-column layouts in the real world....

    Thanks

  4. #4
    Non-Member Egor's Avatar
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    7,305
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by emalrola
    I was not trying to compare css and tables.

    My question stems from tying to find out how to successfully implement a 3-column display using css. I have read various articles (eg; http://css-discuss.incutio.com/?page=ThreeColumnLayouts) and there seems to be a huge amount of discussion as to what works/doesn't work on various platforms and lots of workarounds needed. I am quite happy to adopt such solutions, but at the same time, have not seen a lot of this within live web sites. Does that mean that people are still using tables to do 3-column layouts in the real world....

    Thanks
    Sorry,

    I wasn't meaning to point directly at you. A lot of people still use tables for 3cols. If you want to see some 3 col layouts possible "tableless", have a look at the thread stickied at the top of this forum.

  5. #5
    @alexstanford Alex's Avatar
    Join Date
    Apr 2004
    Location
    Jacksonville, Florida
    Posts
    757
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I made a two column layout using pure CSS and relative possitioning, not absolute. It's not all that difficult.

    You can view at www.shockedstyle.com what I have done. I believe the same ideas could be implimented to make good CSS 3 column websites.
    Alex Stanford @alexstanford tumblog about.me in fb G+ K
    TechTalkin The Premier Community for Technology Enthusiasts and Professionals
    Full Ambit Media Zero Sacrifice Web Design & Development; Made in the USA @fullambit in fb G+ K

  6. #6
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,343
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    I think the problem is that old established sites are unlikely to suddenly change to css straight away but you can be sure that if those sites were being designed today then a number of them would be tableless.

    If you want the classic table layout then stick with a table layout but of course these days you must take into account all the accessibility issues etc. So I would say use the simplest table layout (no nested tables) and then style it completely with css.

    However I think you'll find that a lot of table layouts aren't exactly cross browser compatible either, its just that designers have learned how to work around the problems to some extent.

    On the other hand if you use css to take advantage of its strengths rather than its weaknesses then you can't go far wrong. Yes there are many browsers problems to overcome but this has always been the way. Think about when netscape and ie were almost developing separate systems just to outdo each other. At least things are a little better these days .

    I believe that css is a forward step and that tables are a backward step but at this point in time its probably 6 of one and half a dozen of the other when you weigh up the advantages and disadvantages.

    So in the end it probably comes down to your own choice and your own reasons why you want to code one way or the other.

    Obviously here in the css forum we promote css but that doesn't mean tables are banished, its just that we don't use them much except for tabular data.

    Paul

  7. #7
    SitePoint Member
    Join Date
    Aug 2004
    Location
    KENT, UK
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for a very constructive reply.

    My main problem using css for cols (and I haven't been doing it that long!) is with images - I use IE6 and when I put an image in a floating margin (probably incorrect terminology, but its what everybody's code does - you know what I mean!) it looks good until I come to resize (in particular shrink) my window when the image does not resize and 'floats' all over the text, looking horrible.

    Maybe I'm just missing a bit of vital knowledge, but I'd appreciate any help.

  8. #8
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,343
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    Well, That is one of the problems of a columnar css layout in that the page will tend to try and stay fluid until the end.

    With mozilla you can set min-width and stop the element getting any smaller when it reaches the size of the image etc. Unfortunately ie omitted this very useful style which would solve a lot of layout problems.

    If your layout is breaking quite soon when you resize layout then perhaps the image is too big and the element should be a fixed width to stop this happening.

    However if the layout is only breaking once it gets very small then I don't really think its a problem as usually it all lines up under each other (dependning on layout used of course).

    If this worries you then you could just use a hybrid table to hold the main columns and style the rest with css. You don't need nested tables just a simple 3 column one row table will do and all the elements inside can be css. This may be the best approach for you at this stage and will make the transition to css less painful .

    Paul


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •