(function(f){f.fn.stupidtable=function(j){return this.each(function(){var k=f(this);j=j||{};j=f.extend({},{"int":function(d,a){return parseInt(d,10)-parseInt(a,10)},"float":function(d,a){return parseFloat(d)-parseFloat(a)},string:function(d,a){return d<a?-1:d>a?1:0}},j);k.on("click","th",function(){var d=k.children("tbody").children("tr"),a=f(this),l=0;k.find("th").slice(0,a.index()).each(function(){var a=f(this).attr("colspan")||1;l+=parseInt(a)});var e=a.data("sort")||null;if(e){var c=j[e],g=[];
    d.each(function(a,c){var b=f(c).children().eq(l),b=b.data("sort-value")||b.text();g.push(b)});var e=[],b=g.slice(0),h=g.slice(0).reverse(),i=g.slice(0).sort(c);if((b&&i&&!(b<i||i<b)||h&&i&&!(h<i||i<h))&&null!==a.data("sort-dir")){g.reverse();for(c=g.length-1;0<=c;c--)e.push(c)}else{e=g.slice(0).sort(c);c=[];for(h=b=0;h<g.length;h++){for(b=f.inArray(g[h],e);-1!=f.inArray(b,c);)b++;c.push(b)}e=c}c="asc"===a.data("sort-dir")?"desc":"asc";a.siblings("th").data("sort-dir",null);a.data("sort-dir",c);a=
    e;e=d.slice(0);for(b=0;b<a.length;b++)newIndex=a[b],e[newIndex]=d[b];d=f(e);k.children("tbody").append(d);k.trigger("aftertablesort",{column:l,direction:c})}})})}})(jQuery);

(function(f){f.fn.stupidtable=function(k){return this.each(function(){var h=f(this);k=k||{};k=f.extend({},{"int":function(d,a){return parseInt(d,10)-parseInt(a,10)},"float":function(d,a){return parseFloat(d)-parseFloat(a)},string:function(d,a){return d<a?-1:d>a?1:0}},k);h.on("click","th",function(){var d=h.children("tbody").children("tr"),a=f(this),l=0;h.find("th").slice(0,a.index()).each(function(){var a=f(this).attr("colspan")||1;l+=parseInt(a)});var e=a.data("sort")||null;if(e){var c=k[e],g=[];
d.each(function(a,c){var b=f(c).children().eq(l),b=b.data("sort-value")||b.text();g.push(b)});var e=[],b=g.slice(0),i=g.slice(0).reverse(),j=g.slice(0).sort(c);if((b&&j&&!(b<j||j<b)||i&&j&&!(i<j||j<i))&&null!==a.data("sort-dir")){g.reverse();for(c=g.length-1;0<=c;c--)e.push(c)}else{e=g.slice(0).sort(c);c=[];for(i=b=0;i<g.length;i++){for(b=f.inArray(g[i],e);-1!=f.inArray(b,c);)b++;c.push(b)}e=c}c="asc"===a.data("sort-dir")?"desc":"asc";h.find("th").data("sort-dir",null).removeClass("sorting-desc sorting-asc");
a.data("sort-dir",c).addClass("sorting-"+c);h.trigger("beforetablesort",{column:l,direction:c});a=e;e=d.slice(0);for(b=0;b<a.length;b++)newIndex=a[b],e[newIndex]=d[b];d=f(e);h.children("tbody").append(d);h.trigger("aftertablesort",{column:l,direction:c})}})})}})(jQuery);

Update minified js