Tablesorter stores the entire contents of the table in a cache, so to tell tablesorter that something has changed, you need to call an update:
$('table').trigger('update');
This update has been updated.
$("#ajouterCodePiece").click(function () {
$('#tablesorter-demo-gauche tr:last').after('<tr><td>' + $('#codepiece option:selected').text() + '</td><td>' + $('#mode option:selected').text() + '</td></tr>');
$('#tablesorter-demo-gauche').trigger('update');
});
source
share