是否有现有的表格排序库,或者有没有办法配置表格排序器 http://tablesorter.com/docs/,每两行排序?或者,是否有更好的方法来语义地表达我的表,以便标准行排序可以工作。
我有一个 html 表,看起来像这样
<table>
<thead>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>Some Data: 1</td>
<td>Some More Data:1 </td>
</tr>
<tr>
<td colspan="2">Some text about the above data that puts it in context and visually spans under both of the cells above so as not to create a weird looking table</td>
</tr>
<tr>
<td>Some Data: 2</td>
<td>Some More Data: 2</td>
</tr>
<tr>
<td colspan="2">Some text about the above data 2 set that puts it in context and visually spans under both of the cells above so as not to create a weird looking table</td>
</tr>
</tbody>
</table>
我正在寻找一种对表进行排序的方法,以便表按数据行排序,but带有 colspan 的行与其数据一起移动,并且不单独排序。
有人为 tablesorter 开发了这个功能。查看此页面:
http://blog.pengoworks.com/index.cfm/2008/3/28/Finished-jQuery-Tablesorter-mod-for-Collapsible-Table-Rows http://blog.pengoworks.com/index.cfm/2008/3/28/Finished-jQuery-Tablesorter-mod-for-Collapsible-Table-Rows
您需要做的就是为次要行提供“expand-child”类(这是可配置的)。
正是您所需要的。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)