rem: if (table.rows && table.rows.length > 0) { var firstRow = table.rows[0]; } if (!firstRow) return; 
add: if (table.rows && table.rows.length > 0) { if (table.tHead && table.tHead.rows.length > 0) { var firstRow = table.tHead.rows[table.tHead.rows.length-1]; thead = true; } else { var firstRow = table.rows[0]; } } if (!firstRow) return; 
context: function ts_makeSortable(table) {    if (table.rows && table.rows.length > 0) {        var firstRow = table.rows[0];    }    if (!firstRow) return;    // We have a first row: assume it's the header, and make its contents clickable links    for (var i=0;i<firstRow.cells.length;i++) {        var cell = firstRow.cells[i];        var txt = ts_getInnerText(cell);        cell.innerHTML = txt+'<a href="#" class="sortheader" onclick="ts_resortTable(this);return false;"><img class="sortarrow" src="'+NO_ARROW+'" alt="&#x2195;" /></a>';    }}
meta: 7328	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/7328/aecab3c29373db6e82c71b74856d5e1e7473ce96/sorttable.js/buggy/skins/common/sorttable.js