In tablesorter v2.18.1, you can now target a column by the class name of an element inside of a header; note that the span has the targeted class name in the first name column.
HTML
<table class="tablesorter">
<thead>
<tr>
<th><span class="first-name">First Name</span></th>
...
JS
$("table").tablesorter({
headers: {
'.first-name' : {
sorter: false
}
}
});
In tablesorter v2.0.5 and older, only the metadata and headers options methods were available.
In versions 2.3+, columns can be disabled using any of the following methods (they all do the same thing), in order of priority:
jQuery data data-sorter="false"
.
<table class="tablesorter">
<thead>
<tr>
<th data-sorter="false">Age</th>
....
metadata class="{ sorter: false }"
. (This requires the metadata plugin)
headers option headers : { 0 : { sorter: false } }
.
$("table").tablesorter({
headers : { 0 : { sorter: false }
})
header class name class="sorter-false"
.
<table class="tablesorter">
<thead>
<tr>
<th class="sorter-false">Discount</th>
....
disable a column using jQuery data directly, but do it before the table initializes.
$("table thead th:eq(5)").data("sorter", false);
$("table").tablesorter(