JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://autobahn.tablesorter.com/jquery.tablesorter.min.js"></script>
<div>
<table class="tablesorter">
<caption>unsorted</caption>
<thead>
<tr> <th>A-head</th> <th>B-head</th> <th>C-head</th> </tr>
</thead>
<tfoot>
<tr> <td>A-foot</td> <td>B-foot</td> <td>C-foot</td></tr>
</tfoot>
<tbody>
<!-- group 1 start -->
<tr> <td>100</td> <td>row 1 cell 2</td> <td>row 1 cell 3</td> </tr>
<tr> <td>200</td> <td>row 2 cell 2</td> <td>row 2 cell 3</td> </tr>
<tr> <td>50</td> <td>row 2 cell 2</td> <td>row 2 cell 3</td> </tr>
<tr> <td colspan="3">info for group 1</td> </tr>
<!-- group 1 end -->
<!-- group 2 start -->
<tr> <td>210</td> <td>row 3 cell 2</td> <td>row 3 cell 3</td> </tr>
<tr> <td>250</td> <td>row 4 cell 2</td> <td>row 4 cell 3</td> </tr>
<tr> <td>240</td> <td>row 4 cell 2</td> <td>row 4 cell 3</td> </tr>
<tr> <td colspan="3">info for group 2</td> </tr>
<!-- group 2 end -->
<tr> <td>600</td> <td>row 5 cell 2</td> <td>row 5 cell 3</td> </tr>
</tbody>
</table>
</div>
<div style="float:left:">
<table>
<caption>expexted sort order after click on A-head</caption>
<thead>
<tr> <th>A-head</th> <th>B-head</th> <th>C-head</th> </tr>
</thead>
<tfoot>
<tr> <td>A-foot</td> <td>B-foot</td> <td>C-foot</td></tr>
</tfoot>
<tbody>
<!-- group 1 start -->
<tr> <td>50</td> <td>row 2 cell 2</td> <td>row 2 cell 3</td> </tr>
<tr> <td>100</td> <td>row 1 cell 2</td> <td>row 1 cell 3</td> </tr>
<tr> <td>200</td> <td>row 2 cell 2</td> <td>row 2 cell 3</td> </tr>
<tr> <td colspan="3">info for...
CSS
th, td { border: 1px solid black; padding:1em; }
thead th, tfoot td { background-color: #CCC; }
div {float:left; padding:10px;}
JavaScript
$(document).ready(function() {
$('.tablesorter').tablesorter();
});