However, that code probably worked at some time, so perform a computation to ensure that table.rows isn't getting just the tBody contents.
Please cross browser test.
The last code version of this sortables is on http://yoast.com/articles/sortable-table/ and has changed quite a bit. Joost de Valk suggest
using the jQuery based tablesorter.com.
// Work out a type for the column
// Skip the first row if that's where the headings are
var rowStart = ( table.tHead && table.tHead.rows.length > 0 ? 0 : 1 );
-
+ var bodyRows = 0;
+ if (rowStart == 0 && table.tBodies) {
+ for (var i=0; i < table.tBodies.length; i++ ) {
+ bodyRows += table.tBodies[i].rows.length;
+ }
+ if (bodyRows < table.rows.length)
+ rowStart = 1;
+ }
+
var itm = '';
for ( var i = rowStart; i < table.rows.length; i++ ) {
if ( table.rows[i].cells.length > column ) {