SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Thread: Tables or not

  1. #1
    SitePoint Zealot p2ranger's Avatar
    Join Date
    Jan 2001
    Location
    Colorado, USA
    Posts
    149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Tables or not

    So I have been finding out about how XHTML 2 is going to be a bit different. And I"m also seeing how CSS is very cool.

    However, is XHTML 2 going to do away with tables? Does all content positioning need to be done using CSS? If so why? I understand why CSS is to be used for the "look" of a page.

    Reason I'm asking is I'm making this calendar program in PHP. So that it looks like a normal monthly calendar I used tables with borders to layout the dates in the month. Is this bad practice?

    It seems like it would be a pain in the **** to recreate this using CSS positioning (especially since I'm new to it).

    I know it will work for a while seeing as how no one is going to make a totally XHTML 2 browser in the near future.

    Thanks for your thoughts

    Jason
    ><>
    My home: http://anvilgear.com
    Backpacker/Mountian Biker/Computer Geek Extraordinaire
    "Do what you love and love what you do, anything else is just some form of slavery" - Royal Robbins

  2. #2
    . gdape's Avatar
    Join Date
    Jan 2002
    Location
    in the outskirts, and in the fringes
    Posts
    501
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    we did a site a while back with a calendar http://www.artscalendar.co.nz just using tables, no problem. Any reason for wanting it all css?

  3. #3
    SitePoint Zealot p2ranger's Avatar
    Join Date
    Jan 2001
    Location
    Colorado, USA
    Posts
    149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was wondering if it was bad markup practice the way I am wanting to use tables or if tables were being depreciated in XHTML 2. I just would like for it to be up to standards or ready for the new coming standards.

    Thanks

    Jason
    ><>
    My home: http://anvilgear.com
    Backpacker/Mountian Biker/Computer Geek Extraordinaire
    "Do what you love and love what you do, anything else is just some form of slavery" - Royal Robbins

  4. #4
    SitePoint Addict mserms's Avatar
    Join Date
    Jun 2001
    Location
    Scotland
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My understanding is that tables shouldn't be used for layout as they're meant for tabular data only. Using tables for design breaks the logical markup of the document.

    Hope this makes sense.

  5. #5
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    As many others have stated and myself before; the <table> element is meant for tabulated data unsurprisingly not overall page layout style.

    The main reason why CSS is not always easy to use is because various browser vendors don't correctly apply the W3C Technical Recommendations, etc. Hopefully when CSS-3 is finalised and it becomes mainstream it will be a little easier to use CSS for layouts.

    Personally I've read nowhere were the <table> element is to be deprecated; it's just that there are more favourable alternatives for overall page layout assuming the user-agents are up to the task.

    Perhaps I'd consider a calendar as you described as tabulated data, although applying CSS to the calandar would be considered natural.
    Last edited by xhtmlcoder; Oct 17, 2002 at 03:43.

  6. #6
    SitePoint Addict mserms's Avatar
    Join Date
    Jun 2001
    Location
    Scotland
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's what I was trying to say, cheers xhtmlcoder.

  7. #7
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    I would think that a calendar would be an appropriate use for a table. Your <th> tags are the days of the week and your <td> tags would be filled with the appropriate numbers. I would not find any problem with a table being used to create a calendar (not to mention the pain of using 30+ divs to lay it out otherwise!). I'm all for a full-css layout, but there's no need to take it to such extremes.

    --Vinnie

  8. #8
    SitePoint Zealot p2ranger's Avatar
    Join Date
    Jan 2001
    Location
    Colorado, USA
    Posts
    149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cool

    Thanks for all your input. I feel better now

    Especially since I don't have to lay it out with CSS.

    Jason
    ><>
    My home: http://anvilgear.com
    Backpacker/Mountian Biker/Computer Geek Extraordinaire
    "Do what you love and love what you do, anything else is just some form of slavery" - Royal Robbins

  9. #9
    Back in Action Winged Spider's Avatar
    Join Date
    Jun 2001
    Location
    outside my mind
    Posts
    900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm pretty sure you could use CSS only to create that calender.

    Build a box, and float image links right inside it. They should stack up correct if their sizes are the same. Use spacers for blank days.


  10. #10
    SitePoint Wizard Mincer's Avatar
    Join Date
    Mar 2001
    Location
    London | UK
    Posts
    1,140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The data in a calender is tabular, so it goes in a table. That would be common sense, no? Surely that's what a table is for - tabular data? Perhaps not for site layout, but there are legitimate uses for tables, and I'm of the opinion that this is probably one of them.


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
  •