SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru kili's Avatar
    Join Date
    Jan 2004
    Location
    Damn I need a Crap
    Posts
    788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to set header left cell and right cell

    Hi Guys
    How do I set two cells in the same table (td) left cell & right cell to different sizes without giving them seprate IDs or classes. Is there a left td and right td function in CSS?

    Cheers Kili

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    tr:first-child and tr:last-child.

    However, that won't work everywhere, especially not in IE/Windows. You'll have to go with IDs or classes on this one.

    Off Topic:

    And why would you think there's a "left td" and "right td" selector? If you write in a language like Hebrew, the first table cell would be on the right and the second one would be to the left. Remember that CSS and HTML have to deal with internationalization.

  3. #3
    SitePoint Guru kili's Avatar
    Join Date
    Jan 2004
    Location
    Damn I need a Crap
    Posts
    788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your help vgarcia appreciated.

    As regards the off topic question , I dont write in hebrew never have done never will do. when I do write (or read for that matter) I like most people naturally read from left to write.

    As a complete novice to CSS I think it is fair to say that when one is looking at a two cell structure one might assume that the left cell and the right cell may be treated as distinct objects or elements to be coded.

    Cheers Kili

  4. #4
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by kili
    Thanks for your help vgarcia appreciated.

    As regards the off topic question , I dont write in hebrew never have done never will do. when I do write (or read for that matter) I like most people naturally read from left to write.
    I don't write in Hebrew either, but there are lots of other right-to-left languages in the world. HTML and CSS have to account for all languages in use, including right-to-left languages like Hebrew and Arabic. So to think that the first cell in a table row will always be on the left and the last one will always be on the right is a flawed mental model when you consider all of the world's Web users.
    Quote Originally Posted by kili
    As a complete novice to CSS I think it is fair to say that when one is looking at a two cell structure one might assume that the left cell and the right cell may be treated as distinct objects or elements to be coded.

    Cheers Kili
    How about if I did this to your cells with a user stylesheet?
    Code:
    tr td {
      display: block;
    }
    Now your "left cell" is the "top cell" and your "right cell" is the "bottom cell". Don't treat source code as a spatial relationship. The reason CSS positioning is now in such widespread use is because those relationships don't have to exist anymore. You have to stop thinking in those terms when writing HTML because that line of thought will be less common as time goes on.

  5. #5
    SitePoint Guru kili's Avatar
    Join Date
    Jan 2004
    Location
    Damn I need a Crap
    Posts
    788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    flawed mental , how did you know I've been that way for sometime but the doc assures me I'm getting better lol....

    Okay your losing me now. I cant code to save my life I just botch it toghter, I'm just grateful that programming languges are written in English how the hell you can understand them when English is not your native language must be a nightmare.


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
  •