Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid borders from collapsing

Tags:

html

css

border

This is a question keeping me busy for a while now.

As you can see in the fiddle I'm trying to set a border to the top of the cells. I want to achieve that the borders of the cells look like the border I gave the div. Have you got any idea how to do it? I already tried to set a border-image, but it wouldn't work, too.

like image 287
user1437032 Avatar asked May 22 '26 15:05

user1437032


1 Answers

Are you saying this is what you are expecting: http://jsfiddle.net/35qgP/4/

table {
    width: 50%;
}
.border1 td {
    border-top: 3px solid red;
}
.border2 td {
    border-top: 1px dotted blue;
}
.border3 td {
    border-top: 1px dashed blue;
}

Or use a border-collapse: collapse; for all the tds this way:

td {border-collapse: collapse;}
like image 193
Praveen Kumar Purushothaman Avatar answered May 25 '26 06:05

Praveen Kumar Purushothaman



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!