css合并單元格的方法:首先創(chuàng)建一個(gè)html示例文件;然后通過設(shè)置colspan來合并列;最后再通過設(shè)置rowspan合并行即可。
推薦:《css視頻教程》
css table之合并單元格
colspan 是合并列,rowspan是合并行,合并行的時(shí)候,比如rowspan="2",它的下一行tr會(huì)少一列;合并列的時(shí)候 colspan="2",此行的列會(huì)少一列
<table border="1" style={{margin:200}}> <tbody> <tr> <th colspan="2">我是占位符</th> <th colspan="2">我是占位符</th> </tr> <tr> <th rowspan="2">我是占位符</th> <th>我是占位符</th> <th>我是占位符</th> <th>我是占位符</th> </tr> <tr> <th>我是占位符</th> <th>我是占位符</th> <th>我是占位符</th> </tr> </tbody> </table>效果
css3斜線表頭
<td > <div class="biaotou"> </div></td>.biaotou { border-top: 200px #199fff solid; /*上邊框?qū)挾鹊扔诒砀竦谝恍行懈?/ border-left: 200px #ff8838 solid; /*左邊框?qū)挾鹊扔诒砀竦谝恍械谝桓駥挾?/ }