1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Small question about text alignment in tables.

Discussion in 'CSS' started by exaro, Dec 23, 2005.

  1. #1
    I want to have a TD with text on either end of the TD. Every time I attempted to align part of the text on the right side of the TD it skips a line. Does anyone know how to align it so it stays on the same row but seperates?
     
    exaro, Dec 23, 2005 IP
  2. Colleen

    Colleen Illustrious Member

    Messages:
    6,777
    Likes Received:
    725
    Best Answers:
    1
    Trophy Points:
    430
    #2
    <div style="float:left">Left TD</div><div style="float:right">Right TD</div>

    That works for me, will stay in the same line.
     
    Colleen, Dec 23, 2005 IP
  3. the_pm

    the_pm Peon

    Messages:
    332
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #3
    To build on Colleen's answer a bit, you can quickly and easily specify the spacing between your two pseudo-columns by adding onto those styles like so: <div style="float:left ; width:48%">Left TD</div><div style="float:rightt ; width:48%">Right TD</div>. Now, you'll have a 4% margin between your two floated divs (adjust as needed, of course).
     
    the_pm, Dec 23, 2005 IP
  4. Colleen

    Colleen Illustrious Member

    Messages:
    6,777
    Likes Received:
    725
    Best Answers:
    1
    Trophy Points:
    430
    #4
    Thanks Paul, that's even better. I never thought to add widths, I ended up using margins when I wanted more space.
     
    Colleen, Dec 23, 2005 IP
  5. ramakrishna p

    ramakrishna p Notable Member

    Messages:
    1,798
    Likes Received:
    361
    Best Answers:
    0
    Trophy Points:
    240
    #5
    Colleen and the_pm....Gained some more knowledge with your answers.
    Thanks
    Regards
    Ramakrishna
     
    ramakrishna p, Dec 24, 2005 IP
  6. exaro

    exaro Peon

    Messages:
    615
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thanks. That's just what I needed.
     
    exaro, Dec 24, 2005 IP
  7. Colleen

    Colleen Illustrious Member

    Messages:
    6,777
    Likes Received:
    725
    Best Answers:
    1
    Trophy Points:
    430
    #7
    You're both welcome. :)

    Paul, (the_pm), is a very valueable resource, umm person :D, we all need to strive to be just like him. It's too hard... hehe. :)
     
    Colleen, Dec 25, 2005 IP