I’m currently working with a tablesorter table in which I need to use a custom parser for each header. I’d like to know if there’s an easy way to do this, such as:
table.tablesorter({
headers: {
0-20: {
sorter:'CareerLast'
},
}
});
I know that the above code doesn’t work, but I’m just wondering if there’s a more readable way of applying the custom parser, other than manually placing it on each column by index.
Well, I think you have three choices:
Define each header, 0 through 20 in the initialization options.
Use the meta data plugin and add the sorter definition in the header class:
Try out my forked version of tablesorter and just add the sorter as a class name