- collapse
- separate
separate 為表格儲存格邊框的預設樣式, collapse 會使儲存格邊框不出現。
舉例如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | table { width : 35% ; height : 15% ; margin : 10px ; text-align : center ; border : thin solid black ; } td { border : thin solid black ; } table. collapse { border-collapse : collapse ; } table. separate { border-collapse : separate ; } /* 《程式語言教學誌》的範例程式 檔名:table02.css 功能:示範 CSS 2.1 樣式表的使用 作者:張凱慶 時間:西元 2011 年 7 月 */ |
我們以下面的 HTML 文件載入
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | < html > < head > < title >網頁標題</ title > < link rel = "stylesheet" type = "text/css" href = "table02.css" > </ head > < body > < table class = "collapse" > < tr >< td >1</ td >< td >2</ td ></ tr > < tr >< td >3</ td >< td >4</ td ></ tr > </ table > < table class = "separate" > < tr >< td >1</ td >< td >2</ td ></ tr > < tr >< td >3</ td >< td >4</ td ></ tr > </ table > </ body > </ html > <!-- 《程式語言教學誌》的範例程式 檔名:table02.html 功能:示範 CSS 2.1 樣式表的使用 作者:張凱慶 時間:西元 2011 年 7 月 --> |
瀏覽器 (broswer) 開啟如下

中英文術語對照 | |
---|---|
性質 | property |
關鍵字 | keyword |
瀏覽器 | broswer |
您可以繼續參考
JavaScript 範例
表格
清單
相關目錄
CSS 2.1 快速導覽
HTML, CSS 教材
首頁
參考資料
http://www.w3.org/TR/2011/REC-CSS2-20110607/tables.html
https://developer.mozilla.org/en/CSS/border-collapse
沒有留言:
張貼留言