tsorter
tsorter copied to clipboard
Treats row headers as col headers
It seems like the table is sorted whenever the uses clikcs a th
element. th
can, however, be used for rows as well as for columns (and for rowgroups, but that's rarely seen in the wild). Clicking on such cells should probably not trigger a re-sort-
Example:
<table>
<thead>
<tr>
<th scope="col" data-tsorter="str">City
<th scope="col" data-tsorter="num">Population
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Berlin
<td>1,234,567
</tr>
<tr>
<th scope="row">Berlin
<td>1,234,567
</tr>
</tbody>
</table>