39 users online (1 members and 38 guests)  


  Results 1 to 4 of 4

Related

  1. Html table border    Forum: HTML Forum
    Replies: 1
  2. Unwanted border outside table    Forum: HTML Forum
    Replies: 3
  3. Border for table cell rollover    Forum: CSS Forum
    Replies: 4
  4. Table border help    Forum: HTML Forum
    Replies: 6
  5. Replies: 5
  1. #1
    thesoundguy's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2003
    Posts
    2

    Question Simple Table Border

    I am trying to create a 1px border for all cells and the table, within CSS. I use the {border: 1px solid black;} and tried in both the table section and td section. When in the table section it only creates a 1px border around the whole table, not individual cells. When in the td section it creates the 1px border box around all cells, but between two cells there is a 2px border.

    I hope this is all understandable.... Do I have to manualy enter a border-top, border-bottom in the table section and a border-left and border-right for the td section, but this might also create the 2px border between cells.... ahhh, it is driving me mad!

    Is there a border-rows or rule feature I am overlooking??? Please any help or suggestions will help me from loosing my mind.

    Thanks!
    The Sound Guy

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hiya,

    I have always found that the best compromise is to use a 1px border around the td tags, and a 1px border around the table, too. You end up with a 2px border, but at least all the borders are the same.

    Welcome to the forums!
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    Doorknob's Avatar
    Super Newbie

    Status
    Offline
    Join Date
    Jun 2002
    Location
    Malaysia
    Posts
    316
    when u use {border: 1px solid black;} for a cell, it borders the entire cell with a 1 px border, that means in between cells there are 2 borders, one for both cells, that's why it shows as 2px. if u put space in between the cells (with cellpadding=2), u'll see this. i find it easier to just not put a border around cells, but if u still want cells to have a border, u'll have to manually set border-right, border-left etc. unfortunately, there is no such border-row feature. hope that helps

  4. #4
    thesoundguy's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2003
    Posts
    2

    Problem Solved!

    Thanks for all the info guys!

    I just overlooked a simple method again, but the help of forums always strengthens your knowledge. As for the table I used cellspacing=1 and bg to black and had no borders for the cell. This created the px between all cells and around the whole table. --> Exactly what I needed!

    Thanks again!
    The Sound Guy



Tags for this Thread