Dav*_*mas 91
在意识到你不熟悉的时候colspan,我认为你也不熟悉rowspan,所以我想我会把它扔进去.
需要注意的一点是,使用时rowspan:以下tr元素必须包含较少的td元素,因为rowspan在前一行(或前一行)中使用了单元格.
table {
border: 1px solid #000;
border-collapse: collapse;
}
th,
td {
border: 1px solid #000;
}Run Code Online (Sandbox Code Playgroud)
<table>
<thead>
<tr>
<th colspan="2">Column one and two</th>
<th>Column three</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2" colspan="2">A large cell</td>
<td>a smaller cell</td>
</tr>
<tr>
<!-- note that this row only has _one_ td, since the preceding row
takes up some of this row -->
<td>Another small cell</td>
</tr>
</tbody>
</table>Run Code Online (Sandbox Code Playgroud)
Niv*_*vas 18
colspan属性:
<table>
<tr>
<td> Row 1 Col 1</td>
<td> Row 1 Col 2</td>
</tr>
<tr>
<td colspan=2> Row 2 Long Col</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)