user2579966 user2579966 - 1 month ago 9
jQuery Question

Add an extra heading at the top of table that spans all columns but still allows the table to be sorted on the second row of headings

I'm stumped again. I have tried (all day yesterday) to no avail.

I want to add an extra heading at the top of this table that spans all columns but still allows the table to be sorted on the second row of headings

Answer

The easiest solution would be to disable the sort of the spanned column because the original tablesorter has some issues with sorting the columns below it.

$('table').tablesorter({
    headers: {
        0: { sorter: false } // disable first column
    }
});

Alternatively, you could try out my fork of tablesorter. This demo shows that you can use the spanned header to sort all of the columns below it.