user2781125
user2781125

Reputation:

CSS Border Collapse don't work with value collapse

I have used the css property border-collapse: collapse, but it seems not to be working.

Here is the html

<table cellspacing="0">
    <tr>
        <td>This is demo</td>
        <td>This is demo</td>
    </tr>
    <tr>
        <td>This is demo</td>
        <td>This is demo</td>
    </tr>
    <tr>
        <td>This is demo</td>
        <td>This is demo</td>
    </tr>
</table>   

And the CSS

table tr td {
    border: 2px solid red;
    border-collapse:collapse;
}

Upvotes: 1

Views: 102

Answers (1)

Ashis Kumar
Ashis Kumar

Reputation: 6554

You need to apply the property on the table, not on the td,

table {
    border-collapse:collapse;
}
table tr td {
    border: 2px solid red;
}

Upvotes: 1

Related Questions