border-spacing和borer-collapse以及empty-cells屬性

一、border-spacing 用於設置表格中,單元格之間的間隙

示例1:border-spacing: 7px; 單元格水平方向7px間隔,垂直方向7px間隔
示例2:border-spacing: 20px 30px; 水平方向間隔20px 垂直方向間隔30px (以下圖)
ide

二、border-collapse 設置表格邊框合併,若是每一個單元格都存在邊框,再加上有一點間隙的話(默認是有間距的),對table使用這個屬性,能夠將邊框合併成1條

border-collapse:
值:separate(默認) 邊框會被分開。不會忽略 border-spacing 和 empty-cells 屬性。
collapse: 合併邊框,單元格和單元格之間只存在一條邊框 會忽略 border-spacing 和 empty-cells 屬性。spa

三、empty-cells 設置是否顯示錶格中的空單元格(僅用於「分離邊框」模式--分離邊框模式,就是上面的borer-collapase: separate)。

值: show (默認) 顯示空的單元格(空單元格有邊框)
hide: 不顯示空單元格(空單元格無邊框)
inherit: 繼承父類的empty-cells
blog

相關文章
相關標籤/搜索