diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js index 4a60c90d..a8ce77f8 100644 --- a/js/jquery.tablesorter.js +++ b/js/jquery.tablesorter.js @@ -394,7 +394,7 @@ for (j = 0; j < cells.length; j++) { c = cells[j]; rowIndex = c.parentNode.rowIndex; - cellId = rowIndex + "-" + $(c).cellIndex; + cellId = rowIndex + "-" + $(c).index(); rowSpan = c.rowSpan || 1; colSpan = c.colSpan || 1; if (typeof(matrix[rowIndex]) === "undefined") { @@ -424,7 +424,6 @@ } // may not be accurate if # header columns !== # tbody columns t.config.columns = cols + 1; // add one because it's a zero-based index - return lookup; } function formatSortingOrder(v) { @@ -433,13 +432,15 @@ } function buildHeaders(table) { - var header_index = computeThIndexes(table), ch, $t, - h, i, t, lock, time, c = table.config; + var ch, $t, + h, i, t, lock, time, + c = table.config; c.headerList = []; c.headerContent = []; if (c.debug) { time = new Date(); } + computeThIndexes(table); // add icon if cssIcon option exists i = c.cssIcon ? '' : ''; c.$headers = $(table).find(c.selectorHeaders).each(function(index) { @@ -455,8 +456,7 @@ $(this).html('