<colgroup>标签 span属性设置其列横跨数的组合。
本案例设置的3列,第1列为红色,第2、3列为横跨两列的属性是黄色
<table border="1" > <colgroup style="background-color:red"></colgroup> <colgroup span="2" style="background-color:yellow"></colgroup> <tr> <th>教程课程</th> <th>学习天数</th> <th>学习难度</th> <th>学习费用</th> </tr> <tr> <th>php</th> <th>7天</th> <th>中等</th> <th>免费</th> </tr> <tr> <th>HTML</th> <th>6天</th> <th>简单</th> <th>免费</th> </tr> </table>
![]() | 如果想对组合里面的单独列设置请使用<col>标签。 |
<colgroup span="横跨数"></colgroup>