Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Table bordering

  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Table bordering

    Everything I've learned so far in CSSing is fairly logical, but i can't understand this:

    Code:
    <style type="text/css">
    #list {
            margin-left: 139px;
            margin-top: 20px;
    }
    TD.mainhead {
            height: 20px;
            width: 64px;
            text-align: center;
            border-color: #000;
            border-style: double;
            border-width: 0px 0px 1px 0px;
            padding: 0px;
    }
    TD.secondhead {
            height: 20px;
            width: 128px;
            text-align: center;
            border-color: #000;
            border-style: double;
            border-width: 0px 0px 1px 0px;
            padding: 0px;
    }
    </style>
    <body>
    <table id="list">
        <thead>
        <tr>
        <td class="mainhead">Hello</td>
        <td class="secondhead">Shhhsh</td>
        </tr>
        </thead>
    </table>
    This produces two table cells with a black border below them and no other borders, padding or margin. How come the border lines beneath don't link together when there is meant to be 0 pixels of space between them?

    I know that i can work around this, so I'm not asking anyone to give me a solution. I just want to know the logic that causes this (or lack of logic)? Does it mean those cells are 65px and 129px wide?

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Add border-collapse:collapse; to #list
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by abduraooft View Post
    Add border-collapse:collapse; to #list
    Absolutely perfect. Simple and logical. I had already tried using border-collapse, but put it in the wrong place. Thank you so much for your help.

  • #4
    New Coder
    Join Date
    Jan 2012
    Location
    Romania
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    or you can ad cellspacing to html

    <table id="list" cellspacing="0">


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •