十年網(wǎng)站開發(fā)經(jīng)驗(yàn) + 多家企業(yè)客戶 + 靠譜的建站團(tuán)隊(duì)
量身定制 + 運(yùn)營(yíng)維護(hù)+專業(yè)推廣+無憂售后,網(wǎng)站問題一站解決
這篇文章主要為大家展示了“css如何設(shè)置表格樣式”,內(nèi)容簡(jiǎn)而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領(lǐng)大家一起研究并學(xué)習(xí)一下“css如何設(shè)置表格樣式”這篇文章吧。
成都創(chuàng)新互聯(lián)公司基于分布式IDC數(shù)據(jù)中心構(gòu)建的平臺(tái)為眾多戶提供服務(wù)器托管 四川大帶寬租用 成都機(jī)柜租用 成都服務(wù)器租用。
1、一個(gè)簡(jiǎn)單的表格
table.html
table.css
table,td,th{
border:1pxsolid#aaa;
font-size:23px;
}
2、邊框合并:boder-collapse
屬性值:
separate;(分開,默認(rèn))
collapse;(合并)
table.css
table,td,th{
border:1pxsolid#aaa;
font-size:23px;
border-collapse:collapse;
}
3、邊框間距border-spacing(前提是:border-collapse:separate;)
table.css
table,td,th{
border:1pxsolid#aaa;
font-size:23px;
border-collapse:separate;
border-spacing:45px;
}
4、設(shè)置表格標(biāo)題的位置caption-side
屬性值:
top;//默認(rèn)
bottom;
left;
right;
table.css
table,td,th{
border:1pxsolid#aaa;
font-size:23px;
border-collapse:separate;
border-spacing:45px;
caption-side:bottom;
}
5、當(dāng)單元格對(duì)象寬度超過單元格所定義的寬度時(shí),可用table-layout:fixed保持表格寬度不被改變
屬性值:auto(默認(rèn))
fixed(寬度固定)
table.css
table,td,th{
border:1pxsolid#aaa;
font-size:23px;
border-collapse:separate;
border-spacing:5px;
table-layout:fixed;
caption-side:top;
}
以上是“css如何設(shè)置表格樣式”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對(duì)大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!