Is it possible to add a row to a table built with the jQuery library "Tablesorter" by simply clicking on a button? I have tried this approach, but unfortunately, the new row does not inherit the CSS properties of Tablesorter. As a result, I am unable to select the row and the styling for "odd" and "even" rows does not apply.
$("#ajouterCodePiece").click(function(){
$('#tablesorter-demo-gauche tr:last').after('<tr'><td>'+$('#codepiece option:selected').text()+'</td><td>'+$('#mode option:selected').text()+'</td></tr>');
});
Could someone guide me on how I can ensure that the new row added maintains the CSS and jQuery functionality of Tablesorter? Your help is greatly appreciated! Thank you.