我想在 tr 的末尾添加带有删除图标的额外 td,而不考虑它的第 th 列。
我想以不需要任何 jquery 的方式进行调整,并且表格标签宽度以百分比表示,因此不能再添加 th 并使其不可见。
请引用以下html:
<table>
<tr>
<th>
Col1
</th>
<th>
Col 2
</th>
</tr>
<tr>
<td>
1
</td>
<td>
2
</td>
<td>
<!-- this is new column. -->
Delete Link
</td>
</tr>
</table>
附注我无法添加位置绝对 css,因为它不可能包含在每个屏幕分辨率中。
最佳答案
我理解你的问题了吗? colspan="2"
应该对您有所帮助。
<table>
<tr>
<th>
Col1
</th>
<th colspan="2">
Col 2
</th>
</tr>
<tr>
<td>
1
</td>
<td>
2
</td>
<td>
<!-- this is new column. -->
Delete Link
</td>
</tr>
关于html - 在没有相应 th 的情况下将额外的 td 添加到 tr,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16851283/