From 2d437b3ff94825fe092005a623097a9c4eb7e75e Mon Sep 17 00:00:00 2001 From: Tad Fisher Date: Mon, 1 Aug 2011 10:21:40 -1000 Subject: [PATCH] formatting, add mousewheel to minified dist --- jquery.fixedheadertable.js | 51 ++++++++++++++-------------------- jquery.fixedheadertable.min.js | 40 +++++++++++++------------- 2 files changed, 41 insertions(+), 50 deletions(-) diff --git a/jquery.fixedheadertable.js b/jquery.fixedheadertable.js index ae4e81d..82453b9 100644 --- a/jquery.fixedheadertable.js +++ b/jquery.fixedheadertable.js @@ -18,54 +18,45 @@ * all CSS sizing (width,height) is done in pixels (px) */ -(function($) { +(function ($) { - $.fn.fixedHeaderTable = function( method ) { + $.fn.fixedHeaderTable = function (method) { // plugin's default options var defaults = { - width: '100%', - height: '100%', - themeClass: 'fht-default', - - borderCollapse: true, - fixedColumns: 0, // fixed first columns - sortable: false, - autoShow: true, // hide table after its created - footer: false, // show footer - cloneHeadToFoot: false, // clone head and use as footer - autoResize: false, // resize table if its parent wrapper changes size - - create: null // callback after plugin completes - - } + width: '100%', + height: '100%', + themeClass: 'fht-default', + borderCollapse: true, + fixedColumns: 0, // fixed first columns + sortable: false, + autoShow: true, // hide table after its created + footer: false, // show footer + cloneHeadToFoot: false, // clone head and use as footer + autoResize: false, // resize table if its parent wrapper changes size + create: null // callback after plugin completes + }; - var settings = {} + var settings = {}; // public methods var methods = { - - init : function(options) { - + init: function (options) { settings = $.extend({}, defaults, options); // iterate through all the DOM elements we are attaching the plugin to - return this.each(function() { - + return this.each(function () { var $self = $(this), // reference the jQuery version of the current DOM element self = this; // reference to the actual DOM element if ( helpers._isTable($self) ) { methods.setup.apply(this, Array.prototype.slice.call(arguments, 1)); - $.isFunction(settings.create) && settings.create.call(this); } else { - $.error('Invalid table mark-up'); - } - + $.error('Invalid table mark-up'); + } }); - }, /* @@ -452,7 +443,7 @@ $firstTdChildren.each(function(index) { if (index % settings.fixedColumns == 0) { $newRow = $('').appendTo($tbody.find('tbody')); - + if ( settings.altClass && $(this).parent().hasClass(settings.altClass) ) { $newRow.addClass(settings.altClass); } @@ -693,6 +684,6 @@ } - } + }; })(jQuery); \ No newline at end of file diff --git a/jquery.fixedheadertable.min.js b/jquery.fixedheadertable.min.js index fe771d8..1784b40 100644 --- a/jquery.fixedheadertable.min.js +++ b/jquery.fixedheadertable.min.js @@ -1,20 +1,20 @@ -/*! -* jquery.fixedHeaderTable. The jQuery fixedHeaderTable plugin -* -* Copyright (c) 2011 Mark Malek -* http://fixedheadertable.com -* -* Licensed under MIT -* http://www.opensource.org/licenses/mit-license.php -* -* http://docs.jquery.com/Plugins/Authoring -* jQuery authoring guidelines -* -* Launch : October 2009 -* Version : 1.3 -* Released: May 9th, 2011 -* -* -* all CSS sizing (width,height) is done in pixels (px) -*/ -(function(a){a.fn.fixedHeaderTable=function(f){var e={width:"100%",height:"100%",themeClass:"fht-default",borderCollapse:true,fixedColumn:false,sortable:false,autoShow:true,footer:false,cloneHeadToFoot:false,autoResize:false,create:null};var c={};var b={init:function(g){c=a.extend({},e,g);return this.each(function(){var i=a(this),h=this;if(d._isTable(i)){b.setup.apply(this,Array.prototype.slice.call(arguments,1));a.isFunction(c.create)&&c.create.call(this)}else{a.error("Invalid table mark-up")}})},setup:function(j){var w=a(this),q=this,p=w.find("thead"),h=w.find("tfoot"),r=w.find("tbody"),u,s,n,x,k,g,v=0;c.includePadding=d._isPaddingIncludedWithWidth();c.scrollbarOffset=d._getScrollbarWidth();c.themeClassName=c.themeClass;if(c.width.search("%")>-1){var i=w.parent().width()-c.scrollbarOffset}else{var i=c.width-c.scrollbarOffset}w.css({width:i});if(!w.closest(".fht-table-wrapper").length){w.addClass("fht-table");w.wrap('
')}u=w.closest(".fht-table-wrapper");if(c.fixedColumn==true&&u.find(".fht-fixed-column").length==0){w.wrap('
');var o=a('
').prependTo(u),t=u.find(".fht-fixed-body")}u.css({width:c.width,height:c.height}).addClass(c.themeClassName);if(!w.hasClass("fht-table-init")){w.wrap('
')}x=w.closest(".fht-tbody");var l=d._getTableProps(w);d._setupClone(x,l.tbody);if(!w.hasClass("fht-table-init")){if(c.fixedColumn==true){s=a('
').prependTo(t)}else{s=a('
').prependTo(u)}p.clone().appendTo(s.find("table"))}else{s=u.find("div.fht-thead")}d._setupClone(s,l.thead);w.css({"margin-top":-s.outerHeight(true)});if(c.footer==true){d._setupTableFooter(w,q,l);if(!h.length){h=u.find("div.fht-tfoot table")}v=h.outerHeight(true)}var m=u.height()-p.outerHeight(true)-v-l.border;x.css({height:m});w.addClass("fht-table-init");if(typeof(c.altClass)!=="undefined"){b.altRows.apply(q)}if(c.fixedColumn==true){d._setupFixedColumn(w,q,l)}if(!c.autoShow){u.hide()}d._bindScroll(x,l);return q},resize:function(h){var i=a(this),g=this;return g},altRows:function(i){var j=a(this),h=this,g=(typeof(i)!=="undefined")?i:c.altClass;j.closest(".fht-table-wrapper").find("tbody tr:odd:not(:hidden)").addClass(g)},show:function(j,i,g){var l=a(this),h=this,k=l.closest(".fht-table-wrapper");if(typeof(j)!=="undefined"&&typeof(j)==="number"){k.show(j,function(){a.isFunction(i)&&i.call(this)});return h}else{if(typeof(j)!=="undefined"&&typeof(j)==="string"&&typeof(i)!=="undefined"&&typeof(i)==="number"){k.show(j,i,function(){a.isFunction(g)&&g.call(this)});return h}}l.closest(".fht-table-wrapper").show();a.isFunction(j)&&j.call(this);return h},hide:function(j,i,g){var l=a(this),h=this,k=l.closest(".fht-table-wrapper");if(typeof(j)!=="undefined"&&typeof(j)==="number"){k.hide(j,function(){a.isFunction(g)&&g.call(this)});return h}else{if(typeof(j)!=="undefined"&&typeof(j)==="string"&&typeof(i)!=="undefined"&&typeof(i)==="number"){k.hide(j,i,function(){a.isFunction(g)&&g.call(this)});return h}}l.closest(".fht-table-wrapper").hide();a.isFunction(g)&&g.call(this);return h},destroy:function(){var i=a(this),g=this,h=i.closest(".fht-table-wrapper");i.insertBefore(h).removeAttr("style").append(h.find("tfoot")).removeClass("fht-table fht-table-init").find(".fht-cell").remove();h.remove();return g}};var d={_isTable:function(k){var j=k,h=j.is("table"),i=j.find("thead").length>0,g=j.find("tbody").length>0;if(h&&i&&g){return true}return false},_bindScroll:function(l,g){var k=l,j=k.closest(".fht-table-wrapper"),i=k.siblings(".fht-thead"),h=k.siblings(".fht-tfoot");k.bind("scroll",function(){if(c.fixedColumn==true){var m=j.find(".fht-fixed-column");m.find(".fht-tbody table").css({"margin-top":-k.scrollTop()})}i.find("table").css({"margin-left":-this.scrollLeft});if(c.cloneHeadToFoot){h.find("table").css({"margin-left":-this.scrollLeft})}})},_fixHeightWithCss:function(h,g){if(c.includePadding){h.css({height:h.height()+g.border})}else{h.css({height:h.parent().height()+g.border})}},_fixWidthWithCss:function(h,g){if(c.includePadding){h.css({width:h.width()+g.border})}else{h.css({width:h.parent().width()+g.border})}},_setupFixedColumn:function(x,n,j){var v=x,p=n,u=v.closest(".fht-table-wrapper"),t=u.find(".fht-fixed-body"),l=u.find(".fht-fixed-column"),m=a('
'),q=a('
'),g=a('
'),w=t.find(".fht-thead thead tr th:first-child"),s,o=w.outerWidth(true)+j.border,h=u.width(),r=t.find(".fht-tbody").height()-c.scrollbarOffset,i;d._fixHeightWithCss(w,j);d._fixWidthWithCss(w,j);s=t.find("tbody tr td:first-child").each(function(y){d._fixHeightWithCss(a(this),j);d._fixWidthWithCss(a(this),j)});m.appendTo(l).find("tr").append(w.clone());q.appendTo(l).css({"margin-top":-1,height:r+j.border});s.each(function(y){i=a("").appendTo(q.find("tbody"));if(c.altClass&&a(this).parent().hasClass(c.altClass)){i.addClass(c.altClass)}a(this).clone().appendTo(i)});l.css({width:o});t.css({width:h});if(c.footer==true||c.cloneHeadToFoot==true){var k=t.find(".fht-tfoot thead tr th:first-child");d._fixHeightWithCss(k,j);g.appendTo(l).find("tr").append(k.clone());g.css({top:c.scrollbarOffset})}},_setupTableFooter:function(g,i,h){var m=g,o=i,j=m.closest(".fht-table-wrapper"),l=m.find("tfoot"),n=j.find("div.fht-tfoot");if(!n.length){if(c.fixedColumn==true){n=a('
').appendTo(j.find(".fht-fixed-body"))}else{n=a('
').appendTo(j)}}switch(true){case !l.length&&c.cloneHeadToFoot==true&&c.footer==true:var k=j.find("div.fht-thead");n.empty();k.find("table").clone().appendTo(n);break;case l.length&&c.cloneHeadToFoot==false&&c.footer==true:n.find("table").append(l).css({"margin-top":-h.border});d._setupClone(n,h.tfoot);break}},_getTableProps:function(i){var h={thead:{},tbody:{},tfoot:{},border:0},g=1;if(c.borderCollapse==true){g=2}h.border=(i.find("th:first-child").outerWidth()-i.find("th:first-child").innerWidth())/g;i.find("thead tr:first-child th").each(function(j){h.thead[j]=a(this).width()+h.border});i.find("tfoot tr:first-child td").each(function(j){h.tfoot[j]=a(this).width()+h.border});i.find("tbody tr:first-child td").each(function(j){h.tbody[j]=a(this).width()+h.border});return h},_setupClone:function(k,j){var i=k,g=(i.find("thead").length)?"thead th":(i.find("tfoot").length)?"tfoot td":"tbody td",h;i.find(g).each(function(l){h=(a(this).find("div.fht-cell").length)?a(this).find("div.fht-cell"):a('
').appendTo(a(this));h.css({width:parseInt(j[l])});if(!a(this).closest(".fht-tbody").length&&a(this).is(":last-child")&&!a(this).closest(".fht-fixed-column").length){var m=((a(this).innerWidth()-a(this).width())/2)+c.scrollbarOffset;a(this).css({"padding-right":m+"px"})}})},_isPaddingIncludedWithWidth:function(){var i=a('
test
'),h,g;i.appendTo("body");h=i.find("td").height();i.find("td").css("height",i.find("tr").height());g=i.find("td").height();i.remove();if(h!=g){return true}else{return false}},_getScrollbarWidth:function(){var h=0;if(!h){if(a.browser.msie){var j=a('').css({position:"absolute",top:-1000,left:-1000}).appendTo("body"),i=a('').css({position:"absolute",top:-1000,left:-1000}).appendTo("body");h=j.width()-i.width()+2;j.add(i).remove()}else{var g=a("
").css({width:100,height:100,overflow:"auto",position:"absolute",top:-1000,left:-1000}).prependTo("body").append("
").find("div").css({width:"100%",height:200});h=100-g.width();g.parent().remove()}}return h}};if(b[f]){return b[f].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof f==="object"||!f){return b.init.apply(this,arguments)}else{a.error('Method "'+f+'" does not exist in fixedHeaderTable plugin!')}}}})(jQuery); \ No newline at end of file + +(function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(i){var g=i||window.event,f=[].slice.call(arguments,1),j=0,h=true,e=0,d=0;i=c.event.fix(g);i.type="mousewheel";if(i.wheelDelta){j=i.wheelDelta/120}if(i.detail){j=-i.detail/3}d=j;if(g.axis!==undefined&&g.axis===g.HORIZONTAL_AXIS){d=0;e=-1*j}if(g.wheelDeltaY!==undefined){d=g.wheelDeltaY/120}if(g.wheelDeltaX!==undefined){e=-1*g.wheelDeltaX/120}f.unshift(i,j,e,d);return c.event.handle.apply(this,f)}})(jQuery);/*! + jquery.fixedHeaderTable. The jQuery fixedHeaderTable plugin + + Copyright (c) 2011 Mark Malek + http://fixedheadertable.com + + Licensed under MIT + http://www.opensource.org/licenses/mit-license.php + + http://docs.jquery.com/Plugins/Authoring + jQuery authoring guidelines + + Launch : October 2009 + Version : 1.3 + Released: May 9th, 2011 + + + all CSS sizing (width,height) is done in pixels (px) + */(function($){$.fn.fixedHeaderTable=function(method){var defaults={width:'100%',height:'100%',themeClass:'fht-default',borderCollapse:true,fixedColumns:0,sortable:false,autoShow:true,footer:false,cloneHeadToFoot:false,autoResize:false,create:null};var settings={};var methods={init:function(options){settings=$.extend({},defaults,options);return this.each(function(){var $self=$(this),self=this;if(helpers._isTable($self)){methods.setup.apply(this,Array.prototype.slice.call(arguments,1));$.isFunction(settings.create)&&settings.create.call(this);}else{$.error('Invalid table mark-up');}});},setup:function(options){var $self=$(this),self=this,$thead=$self.find('thead'),$tfoot=$self.find('tfoot'),$tbody=$self.find('tbody'),$wrapper,$divHead,$divFoot,$divBody,$fixedHeadRow,$temp,tfootHeight=0;settings.includePadding=helpers._isPaddingIncludedWithWidth();settings.scrollbarOffset=helpers._getScrollbarWidth();settings.themeClassName=settings.themeClass;if(settings.width.search('%')>-1){var widthMinusScrollbar=$self.parent().width()-settings.scrollbarOffset;}else{var widthMinusScrollbar=settings.width-settings.scrollbarOffset;}$self.css({width:widthMinusScrollbar});if(!$self.closest('.fht-table-wrapper').length){$self.addClass('fht-table');$self.wrap('
');}$wrapper=$self.closest('.fht-table-wrapper');if(settings.fixedColumns>0&&$wrapper.find('.fht-fixed-column').length==0){$self.wrap('
');var $fixedColumns=$('
').prependTo($wrapper),$fixedBody=$wrapper.find('.fht-fixed-body');}$wrapper.css({width:settings.width,height:settings.height}).addClass(settings.themeClassName);if(!$self.hasClass('fht-table-init')){$self.wrap('
');}$divBody=$self.closest('.fht-tbody');var tableProps=helpers._getTableProps($self);helpers._setupClone($divBody,tableProps.tbody);if(!$self.hasClass('fht-table-init')){if(settings.fixedColumns>0){$divHead=$('
').prependTo($fixedBody);}else{$divHead=$('
').prependTo($wrapper);}$thead.clone().appendTo($divHead.find('table'));}else{$divHead=$wrapper.find('div.fht-thead');}helpers._setupClone($divHead,tableProps.thead);$self.css({'margin-top':-$divHead.outerHeight(true)});if(settings.footer==true){helpers._setupTableFooter($self,self,tableProps);if(!$tfoot.length){$tfoot=$wrapper.find('div.fht-tfoot table');}tfootHeight=$tfoot.outerHeight(true);}var tbodyHeight=$wrapper.height()-$thead.outerHeight(true)-tfootHeight-tableProps.border;$divBody.css({'height':tbodyHeight});$self.addClass('fht-table-init');if(typeof(settings.altClass)!=='undefined'){methods.altRows.apply(self);}if(settings.fixedColumns>0){helpers._setupFixedColumn($self,self,tableProps);}if(!settings.autoShow){$wrapper.hide();}helpers._bindScroll($divBody,tableProps);return self;},resize:function(options){var $self=$(this),self=this;return self;},altRows:function(arg1){var $self=$(this),self=this,altClass=(typeof(arg1)!=='undefined')?arg1:settings.altClass;$self.closest('.fht-table-wrapper').find('tbody tr:odd:not(:hidden)').addClass(altClass);},show:function(arg1,arg2,arg3){var $self=$(this),self=this,$wrapper=$self.closest('.fht-table-wrapper');if(typeof(arg1)!=='undefined'&&typeof(arg1)==='number'){$wrapper.show(arg1,function(){$.isFunction(arg2)&&arg2.call(this);});return self;}else if(typeof(arg1)!=='undefined'&&typeof(arg1)==='string'&&typeof(arg2)!=='undefined'&&typeof(arg2)==='number'){$wrapper.show(arg1,arg2,function(){$.isFunction(arg3)&&arg3.call(this);});return self;}$self.closest('.fht-table-wrapper').show();$.isFunction(arg1)&&arg1.call(this);return self;},hide:function(arg1,arg2,arg3){var $self=$(this),self=this,$wrapper=$self.closest('.fht-table-wrapper');if(typeof(arg1)!=='undefined'&&typeof(arg1)==='number'){$wrapper.hide(arg1,function(){$.isFunction(arg3)&&arg3.call(this);});return self;}else if(typeof(arg1)!=='undefined'&&typeof(arg1)==='string'&&typeof(arg2)!=='undefined'&&typeof(arg2)==='number'){$wrapper.hide(arg1,arg2,function(){$.isFunction(arg3)&&arg3.call(this);});return self;}$self.closest('.fht-table-wrapper').hide();$.isFunction(arg3)&&arg3.call(this);return self;},destroy:function(){var $self=$(this),self=this,$wrapper=$self.closest('.fht-table-wrapper');$self.insertBefore($wrapper).removeAttr('style').append($wrapper.find('tfoot')).removeClass('fht-table fht-table-init').find('.fht-cell').remove();$wrapper.remove();return self;}}var helpers={_isTable:function($obj){var $self=$obj,hasTable=$self.is('table'),hasThead=$self.find('thead').length>0,hasTbody=$self.find('tbody').length>0;if(hasTable&&hasThead&&hasTbody){return true;}return false;},_bindScroll:function($obj,tableProps){var $self=$obj,$wrapper=$self.closest('.fht-table-wrapper'),$thead=$self.siblings('.fht-thead'),$tfoot=$self.siblings('.fht-tfoot');$self.bind('scroll',function(){if(settings.fixedColumns>0){var $fixedColumns=$wrapper.find('.fht-fixed-column');$fixedColumns.find('.fht-tbody table').css({'margin-top':-$self.scrollTop()});}$thead.find('table').css({'margin-left':-this.scrollLeft});if(settings.cloneHeadToFoot){$tfoot.find('table').css({'margin-left':-this.scrollLeft});}});},_fixHeightWithCss:function($obj,tableProps){if(settings.includePadding){$obj.css({'height':$obj.height()+tableProps.border});}else{$obj.css({'height':$obj.parent().height()+tableProps.border});}},_fixWidthWithCss:function($obj,tableProps,width){if(settings.includePadding){$obj.each(function(index){$(this).css({'width':width==undefined?$(this).width()+tableProps.border:width+tableProps.border});});}else{$obj.each(function(index){$(this).css({'width':width==undefined?$(this).parent().width()+tableProps.border:width+tableProps.border});});}},_setupFixedColumn:function($obj,obj,tableProps){var $self=$obj,self=obj,$wrapper=$self.closest('.fht-table-wrapper'),$fixedBody=$wrapper.find('.fht-fixed-body'),$fixedColumn=$wrapper.find('.fht-fixed-column'),$thead=$('
'),$tbody=$('
'),$tfoot=$('
'),$firstThChildren,$firstTdChildren,fixedColumnWidth,fixedBodyWidth=$wrapper.width(),fixedBodyHeight=$fixedBody.find('.fht-tbody').height()-settings.scrollbarOffset,$newRow;$firstThChildren=$fixedBody.find('.fht-thead thead tr th:lt('+settings.fixedColumns+')');fixedColumnWidth=settings.fixedColumns*tableProps.border;$firstThChildren.each(function(index){fixedColumnWidth+=$(this).outerWidth(true);});helpers._fixHeightWithCss($firstThChildren,tableProps);helpers._fixWidthWithCss($firstThChildren,tableProps);var tdWidths=[];$firstThChildren.each(function(index){tdWidths.push($(this).width());});firstTdChildrenSelector='tbody tr td:not(:nth-child(n+'+(settings.fixedColumns+1)+'))';$firstTdChildren=$fixedBody.find(firstTdChildrenSelector).each(function(index){helpers._fixHeightWithCss($(this),tableProps);helpers._fixWidthWithCss($(this),tableProps,tdWidths[index%settings.fixedColumns]);});$thead.appendTo($fixedColumn).find('tr').append($firstThChildren.clone());$tbody.appendTo($fixedColumn).css({'margin-top':-1,'height':fixedBodyHeight+tableProps.border});var $newRow;$firstTdChildren.each(function(index){if(index%settings.fixedColumns==0){$newRow=$('').appendTo($tbody.find('tbody'));if(settings.altClass&&$(this).parent().hasClass(settings.altClass)){$newRow.addClass(settings.altClass);}}$(this).clone().appendTo($newRow);});$fixedColumn.css({'height':0,'width':fixedColumnWidth})var maxTop=$fixedColumn.find('.fht-tbody .fht-table').height()-$fixedColumn.find('.fht-tbody').height();console.log(maxTop);$fixedColumn.find('.fht-table').bind('mousewheel',function(event,delta){var top=parseInt($(this).css('marginTop'),10)+(delta>0?40:-40);if(top>0)top=0;if(top<-maxTop)top=-maxTop;$(this).css('marginTop',top);$fixedBody.find('.fht-tbody').scrollTop(-top);});$fixedBody.css({'width':fixedBodyWidth});if(settings.footer==true||settings.cloneHeadToFoot==true){var $firstTdFootChild=$fixedBody.find('.fht-tfoot thead tr th:lt('+settings.fixedColumns+')');helpers._fixHeightWithCss($firstTdFootChild,tableProps);$tfoot.appendTo($fixedColumn).find('tr').append($firstTdFootChild.clone());$tfoot.css({'top':settings.scrollbarOffset});}},_setupTableFooter:function($obj,obj,tableProps){var $self=$obj,self=obj,$wrapper=$self.closest('.fht-table-wrapper'),$tfoot=$self.find('tfoot'),$divFoot=$wrapper.find('div.fht-tfoot');if(!$divFoot.length){if(settings.fixedColumns>0){$divFoot=$('
').appendTo($wrapper.find('.fht-fixed-body'));}else{$divFoot=$('
').appendTo($wrapper);}}switch(true){case!$tfoot.length&&settings.cloneHeadToFoot==true&&settings.footer==true:var $divHead=$wrapper.find('div.fht-thead');$divFoot.empty();$divHead.find('table').clone().appendTo($divFoot);break;case $tfoot.length&&settings.cloneHeadToFoot==false&&settings.footer==true:$divFoot.find('table').append($tfoot).css({'margin-top':-tableProps.border});helpers._setupClone($divFoot,tableProps.tfoot);break;}},_getTableProps:function($obj){var tableProp={thead:{},tbody:{},tfoot:{},border:0},borderCollapse=1;if(settings.borderCollapse==true){borderCollapse=2;}tableProp.border=($obj.find('th:first-child').outerWidth()-$obj.find('th:first-child').innerWidth())/borderCollapse;$obj.find('thead tr:first-child th').each(function(index){tableProp.thead[index]=$(this).width()+tableProp.border;});$obj.find('tfoot tr:first-child td').each(function(index){tableProp.tfoot[index]=$(this).width()+tableProp.border;});$obj.find('tbody tr:first-child td').each(function(index){tableProp.tbody[index]=$(this).width()+tableProp.border;});return tableProp;},_setupClone:function($obj,cellArray){var $self=$obj,selector=($self.find('thead').length)?'thead th':($self.find('tfoot').length)?'tfoot td':'tbody td',$cell;$self.find(selector).each(function(index){$cell=($(this).find('div.fht-cell').length)?$(this).find('div.fht-cell'):$('
').appendTo($(this));$cell.css({'width':parseInt(cellArray[index])});if(!$(this).closest('.fht-tbody').length&&$(this).is(':last-child')&&!$(this).closest('.fht-fixed-column').length){var padding=(($(this).innerWidth()-$(this).width())/2)+settings.scrollbarOffset;$(this).css({'padding-right':padding+'px'});}});},_isPaddingIncludedWithWidth:function(){var $obj=$('
test
'),defaultHeight,newHeight;$obj.appendTo('body');defaultHeight=$obj.find('td').height();$obj.find('td').css('height',$obj.find('tr').height());newHeight=$obj.find('td').height();$obj.remove();if(defaultHeight!=newHeight){return true;}else{return false;}},_getScrollbarWidth:function(){var scrollbarWidth=0;if(!scrollbarWidth){if($.browser.msie){var $textarea1=$('').css({position:'absolute',top:-1000,left:-1000}).appendTo('body'),$textarea2=$('').css({position:'absolute',top:-1000,left:-1000}).appendTo('body');scrollbarWidth=$textarea1.width()-$textarea2.width()+2;$textarea1.add($textarea2).remove();}else{var $div=$('
').css({width:100,height:100,overflow:'auto',position:'absolute',top:-1000,left:-1000}).prependTo('body').append('
').find('div').css({width:'100%',height:200});scrollbarWidth=100-$div.width();$div.parent().remove();}}return scrollbarWidth;}}if(methods[method]){return methods[method].apply(this,Array.prototype.slice.call(arguments,1));}else if(typeof method==='object'||!method){return methods.init.apply(this,arguments);}else{$.error('Method "'+method+'" does not exist in fixedHeaderTable plugin!');}};})(jQuery); \ No newline at end of file