1
我需要能夠在表格單元之間留出空間,但它也會在表格的兩側增加空間。如何去除側面的空間?這裏是fiddle。 <table>
標籤也可以用於此,但問題依然矗立僅限內部的邊框間距
<div class="wrapper">
<div class="table">
<div class="cell">
</div>
<div class="cell">
</div>
<div class="cell">
</div>
</div>
<div class="something-else">
some other elements, table sides should align with this
</div>
</div>
.wrapper {
border: 1px solid green;
padding: 5px;
}
.table {
display: table;
border-spacing: 15px 0;
width: 100%;
}
.cell {
display: table-cell;
height: 50px;
border: 1px solid blue;
}
.something-else {
border: 1px solid red;
margin-top: 10px;
}
有沒有理由你不使用'table'? – 2013-03-19 22:20:33
也可以使用表,但問題將保持不變。如果你知道一個表的解決方案,請分享:) – skyisred 2013-03-19 22:27:14
看着你的小提琴,它看起來不像你試圖呈現表格數據,但創建一個佈局?如果這是正確的,我認爲所有的'display:table'和'display:table-cell'都可能使問題複雜化。你能澄清一下(從更一般的意義上說)你在這裏試圖達到什麼目的? – 2013-03-19 22:35:26