1
我想要有行組的表格看起來類似於此我該如何製作這樣的分組行?
但我不能完全弄清楚。我試過使用多個<tbody>
元素,在我的<td>
元素上調整colspan
,但這兩個元素都不適合我。如果它使任務更容易,我使用jQuery DataTables。
編輯:這裏就是我有
<table id="groupedTable">
<thead>
<tr>
<th>Group</th>
<th>Name</th>
</tr>
</thead>
<tbody>
<tr>
<td>Group1</td>
<td>test</td>
</tr>
<tr>
<td>Group1</td>
<td>test</td>
</tr>
<tr>
<td>Group1</td>
<td>test</td>
</tr>
<tr>
<td>Group1</td>
<td>test</td>
</tr>
<tr>
<td>Group1</td>
<td>test</td>
</tr>
<tr>
<td>Group1</td>
<td>test</td>
</tr>
</tbody>
<tbody>
<tr>
<td>Group2</td>
<td>test</td>
</tr>
<tr>
<td>Group2</td>
<td>test</td>
</tr>
<tr>
<td>Group2</td>
<td>test</td>
</tr>
<tr>
<td>Group2</td>
<td>test</td>
</tr>
<tr>
<td>Group2</td>
<td>test</td>
</tr>
<tr>
<td>Group2</td>
<td>test</td>
</tr>
</tbody>
</table>
是的,我知道壓痕是古怪的,通過在這裏編輯恨我
添加一些代碼的,使人們可以改善它。 – Tavo
@Tavo好的,它完成了 – zero01alpha