我正在構建一個動態表格。表格邊框間距:表格沒有空間
每個單元格都有灰色的背景色,我希望每個單元格之間有一個空白區域(垂直和水平)。
所以我使用的CSS屬性
table {
border-spacing:10px;
}
td {
background-color:grey;
}
它運作良好,除了事實,這白色的空間不僅是細胞之間;它實際上是在每個單元格周圍,包括位於表格邊緣的單元格。
這意味着桌子周圍有白色空間。
有沒有辦法地說:「把例外的單元格邊框之間的空間,如果該邊界在桌子上的邊緣」
注:這是一個動態表,所以我想避免爲「內部」單元提供專用的CSS類。
是的人,你是唯一! – Ren