I am using Motties tablesorter table, which works like a charm. Now I need to update the column headers dynamically and optionally the tables contents. Update the content works fine. How I would update the table header text of a tablesorter table ? This is how I update the table2 contents:
var $table = $('#table2');
$.tablesorter.clearTableBody( $table[0] );
$("#table2 tbody").append(data);
var resort = true;
$("#table2").trigger("update", [resort]);
How would I update the table header only ? I thought I could do this way :
var headers= ["Banana", "Orange", "Apple", "Mango"];
$('table2 thead').html('<tr>' + headers + '</tr>');
but it does only append a new header on top of the header line.