Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Table spacing in html

Tags:

html

css

For what ever reason, I get a small gap in between the two TD cells (Lines dont touch). There is no padding or margin on that side... I did this collapsing idea.

Why is it there? http://jsfiddle.net/CKy6U/

My html:

<table>
    <tr>
        <td>
            TEST CELL 1
        </td>
         <td>
             TEST CELL 2
        </td>
    </tr>
</table>

my CSS:

table
{
    width: 100%;
}
tr
{
    border-bottom: 1px solid Black;
}

td
{
    border-collapse: separate;
    border-spacing: 0px;
    border-left: 1px solid Black;
    border-bottom: 1px solid Black;
    padding: 3px;
    width: 50%;
}

My Result: enter image description here

like image 948
Mcloving Avatar asked Apr 14 '26 04:04

Mcloving


1 Answers

Add Border Collapse for table.

table
{
width: 100%;
border-collapse:collapse;
}

DEMO

like image 193
Suresh Ponnukalai Avatar answered Apr 16 '26 22:04

Suresh Ponnukalai



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!