我有一个表格,我的目标是能够卡住表格的前 3 列。这包括具有 colspan = 3
属性的 thead
。
表格如下所示:
|----colspan: 3------|--------------colspan: n----------------------|
|------|––----|------|--------------n columns-----------------------|
我看到一些回复修复第一列,但没有令人满意的解决方案来修复前 2 或 3 列,或者更普遍地修复前 n 列,当涉及 colspan 时更是如此。
可以用纯 html/css 来完成吗?我需要使用嵌套表格吗?
已经谢谢了!
最佳答案
也许您需要使用 colspan=""
和 rowspan=""
你的意思是这样的吗?
<table width="700" border="2" margin="auto" align="center" cellspacing="3" cellpadding="10">
<tbody align="center">
<tr>
<th colspan="4">Are you meaning something like this?</th>
</tr>
<tr>
<td rowspan="5" valign="top">123<br>1<br>2<br>3<br>4<br></td>
<td colspan="3" rowspan="1">123456789<br>1<br>2<br>3<br></td>
</tr>
<tr>
<td>123</td>
<td>123</td>
<td>123</td>
</tr>
</tbody>
</table>
关于jquery - 卡住html表中的多列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23766091/