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.

CSS equivalent of cellspacing='0'

Discussion in 'CSS' started by fatabbot, May 3, 2007.

  1. #1
    how come it's easy to set the padding of a table(cellpadding='0') in css with the line padding:0;

    and there is no such thing as spacing:0; ...
    SEMrush
    How does this work in CSS?
     
    fatabbot, May 3, 2007 IP
    SEMrush
  2. deques

    deques Peon

    Messages:
    206
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try padding: 0;
     
    deques, May 3, 2007 IP
  3. fatabbot

    fatabbot Peon

    Messages:
    559
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    sigh ......
     
    fatabbot, May 3, 2007 IP
  4. deques

    deques Peon

    Messages:
    206
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #4
    meaning?
    did it help or did it not work as you wanted?
     
    deques, May 3, 2007 IP
  5. silverblade

    silverblade Peon

    Messages:
    153
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #5
    That's the first line he posted and then you repeat that ;)

    But as far as I know there is no specific css command to give exactly the same effect as cellspacing, maybe you could it with margins.
     
    silverblade, May 3, 2007 IP
  6. fatabbot

    fatabbot Peon

    Messages:
    559
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #6
    If you read the question, you would know.
     
    fatabbot, May 3, 2007 IP
  7. deques

    deques Peon

    Messages:
    206
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #7
    ok, you could say that instead of *sigh*

    padding is sort of spacing. it sets a margin between the box and the content. (not the margin between elements)

    does this answer the question?
     
    deques, May 3, 2007 IP
  8. Clive

    Clive Web Developer

    Messages:
    4,507
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    250
    #8
    deques, try adding this to your stylesheets
    table {
     border-collapse: collapse;
    }
    td {
     margin: 0;
    }
    Code (markup):
     
    Clive, May 3, 2007 IP
    fatabbot likes this.
  9. fatabbot

    fatabbot Peon

    Messages:
    559
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #9
    That works, Thank you :)
     
    fatabbot, May 3, 2007 IP
    Clive likes this.
  10. Clive

    Clive Web Developer

    Messages:
    4,507
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    250
    #10
    Glad it does :) Let us know if any other css issue.
     
    Clive, May 3, 2007 IP
  11. kk5st

    kk5st Prominent Member

    Messages:
    3,494
    Likes Received:
    373
    Best Answers:
    28
    Trophy Points:
    335
    #11
    The css equivalent is border-spacing. All modern browsers support the property. IE, (are you ready?) doesn't support it.

    For zero spacing, and merged cell borders, the {border-collapse: collapse;} is what you need. If borders are to be separate, you still need to use the cellspacing attribute for IE.

    cheers,

    gary
     
    kk5st, May 3, 2007 IP
    Clive and fatabbot like this.
  12. fatabbot

    fatabbot Peon

    Messages:
    559
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Thanks, that brings alot of answers :)
     
    fatabbot, May 3, 2007 IP