SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Aug 2002
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Padding or margin in table column?

    Hopefully this is an easy one for one of you gurus out there. I've been trying to figure out how to indent text within a left justified table column. I have tried adding margin-left:5; and padding-left:5; to the <td> element, but to no avail. Any ideas?

    Thanks,

    Bill

  2. #2
    SitePoint Enthusiast blakems's Avatar
    Join Date
    Oct 2002
    Location
    Utah
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can easily put a div around the text in that column and give the div a style of margin: 10px.

    You can't do a margin on a td, but generally padding works fine on a td ie <td style="padding: 10px;"> </td>
    blakems.com
    "reaching more of your brain cells"


  3. #3
    Happy Holidays !! Paul S's Avatar
    Join Date
    Mar 2001
    Location
    Mexico
    Posts
    1,287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How about

    padding-left:5px (you need to set the units)

    Paul

  4. #4
    SitePoint Member
    Join Date
    Aug 2002
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using <div> worked perfectly.

    I was using <span>, which worked on the regular text, but I suppose tables are just different...

    padding-left:5; also worked - I'm not sure why it didn't before... (user error I'm sure!)

    Thanks to both of you!

    Bill


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
  •