table消除 td 之間的間距

有兩種方式可以實現

1.<table cellspacing="0">

2.css 的border-collapse:collapse樣式

通過上面的方法可以實現這樣的效果


具體的 css 代碼

.dir{
    width: 400px;
    height: 150px;
    text-align: center;
    margin-top: 20px;
    margin-left: 20px;
    border-left: #eeeeee solid 1px;
    border-top:#eeeeee solid 1px;
    border-collapse:collapse;
}
.dir td{
    width:25%;
    border-right: #eeeeee solid 1px;
    border-bottom: #eeeeee solid 1px;
}

.dir th{
    width: 25%;
    border-bottom: 1px solid #eeeeee;
    border-right: 1px solid #eeeeee;
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章