我有一个包含多行和多列的HTML表。我想将td
附加到这些行中的一些行,以便td
看起来像是新行,并跨越整个表的宽度。这有助于将单个表行的所有数据保存在同一个tr
标记下,并允许我显示与同一行相关但无法放入单个表列的额外数据,例如长格式注释。例如:
<table>
<thead>
<th>Col 1</th>
<th>Col 2</th>
<th>Col 3</th>
</thead>
<tbody>
<tr>
<td>First</td>
<td>Second</td>
<td>Third</td>
<td class="magic" colspan="3">
This is long-form data that should look like a full-width
row without creating an extra tr tag to hold it.
</td>
</tr>
</tbody>
</table>
注意,同一个表还使用jquery-ui ui来允许对行进行拖放,以便对它们进行排序。此外,还会打印最终结果。
我如何做到这一点,而不搞乱我的标记与非法的div或完全放弃html表?
https://stackoverflow.com/questions/50689750
复制相似问题