I have a 3 column table (name, author, and date). When the page loads, it sorts the first column (name) by default. How can I make it sort the 3rd column (date) by default when the page loads? Is it something to do with sortList? Thanks for any help.
$(document).ready(function()
{
$("#SomeList").tablesorter( {sortList: [[0,0], [1,0]]} );
}
);
$("#SomeList").tablesorter({
widgets: ['zebra'],
dateFormat: "uk",
sortList: [[0, 0]],
headers: { 2: { sorter: false}}
});
You can also pass in configuration options when you initialize the table using the sortList argument:
Here’s how to sort on the 3rd column
Reference:
tablesorter – Set a initial sorting order