JSFiddle - React, Tailwind, and code Playground
HTML
<table name="mytable" id="mytable">
<thead><tr><th nowrap="" style="width:60px" class=" table-cell-raw"></th><th nowrap="" class=" table-cell-raw"><a href="?order_by=id&order_by_desc=1">ID</a></th><th nowrap="" class=" table-cell-raw"><a href="?order_by=name">Enseigne</a></th><th nowrap="" class=" table-cell-raw"><a href="?order_by=date_creation">Date de création</a></th><th nowrap="" class=" table-cell-raw"><a href="?order_by=date_expiration">Date d'expiration</a></th><th nowrap="" class=" table-cell-raw"><a href="?order_by=abonnement&order_by_desc=0">Forfait ▼</a></th><th nowrap="" class=" table-cell-raw"><a href="?order_by=type_account">Type</a></th><th nowrap="" class=" table-cell-raw"><a href="?order_by=module_actif">Module Actif</a></th><th nowrap="" style="width:60px" class=" table-cell-raw"></th></tr></thead><tbody><tr><td name="__action_edit__" style="width:60px" class=" table-cell-raw"><a href="https://www.hotelpushmarketing.com/admin/fr/auto/etb/edit.html?id=111" class="btn btn-block btn-sm btn-primary"> <span class="glyphicon glyphicon-edit"></span> </a></td><td name="id" class=" table-cell-raw">111</td><td name="name" class=" table-cell-raw"><a href="https://www.hotelpushmarketing.com//dashboard?action=autologin&id=111" target="_blank"><i class="fa fa-key"></i></a> <span class="label label-default">Maranatha</span> <strong>Saint Quentin</strong><br>
<a target="_blank" href="https://paris-hotel-saint-quentin.com/fr/">https://paris-hotel-saint-quentin.com/fr/</a><br></td><td name="date_creation" class=" table-cell-raw"><span class="label label-success">06/07/2017</span></td><td name="date_expiration" class=" table-cell-raw"><span class="label label-default"><i class="icon icon-repeat"></i></span></td><td name="abonnement" class=" table-cell-raw"> <span> <strong>0</strong>/2000</span><br>
</td><td name="type_account" class=" table-cell-raw">Prospect</td><td name="module_actif" class=" table-cell-raw"><div class="jsBoolean"...
JavaScript
function sortTable(table, order) {
var asc = order === 'asc',
tbody = table.find('tbody');
tbody.find('tr').sort(function(a, b) {
if (asc) {
alert($('td:nth-child(5) strong'))
return $('td:nth-child(6) strong', a).text().localeCompare($('td:nth-child(6) strong', b).text());
} else {
alert($('td:nth-child(6) strong', b).text())
return $('td:nth-child(6) strong', b).text().localeCompare($('td:nth-child(6) strong', a).text());
}
}).appendTo(tbody);
}
sortTable($('#mytable'),'desc');