Fix column widths on FF3.x

master
Tad Fisher 2011-08-01 09:12:58 -10:00
parent 973aa1118d
commit 2ef1314562
1 changed files with 12 additions and 6 deletions

View File

@ -379,20 +379,21 @@
/* /*
* return void * return void
*/ */
_fixWidthWithCss: function( $obj, tableProps ) { _fixWidthWithCss: function( $obj, tableProps, width ) {
if ( settings.includePadding ) { if ( settings.includePadding ) {
$obj.each(function(index) { $obj.each(function(index) {
$(this).css({ $(this).css({
'width': $(this).width() + tableProps.border 'width': width == undefined ? $(this).width() + tableProps.border : width + tableProps.border
}); });
}); });
} else { } else {
$obj.each(function(index) { $obj.each(function(index) {
$(this).css({ $(this).css({
'width': $(this).parent().width() + tableProps.border 'width': width == undefined ? $(this).parent().width() + tableProps.border : width + tableProps.border
}); });
}); });
} }
}, },
/* /*
@ -424,11 +425,16 @@
helpers._fixHeightWithCss( $firstThChildren, tableProps ); helpers._fixHeightWithCss( $firstThChildren, tableProps );
helpers._fixWidthWithCss( $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) + '))'; firstTdChildrenSelector = 'tbody tr td:not(:nth-child(n+' + (settings.fixedColumns + 1) + '))';
$firstTdChildren = $fixedBody.find(firstTdChildrenSelector) $firstTdChildren = $fixedBody.find(firstTdChildrenSelector)
.each( function(index) { .each( function(index) {
helpers._fixHeightWithCss( $(this), tableProps ); helpers._fixHeightWithCss( $(this), tableProps);
helpers._fixWidthWithCss( $(this), tableProps ); helpers._fixWidthWithCss( $(this), tableProps, tdWidths[index % settings.fixedColumns] );
}); });
// clone header // clone header