Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Bad column width when some of the columns are collapsed (hidden) #84

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions jquery.fixedheadertable.js
Original file line number Diff line number Diff line change
@@ -126,9 +126,13 @@

if (!$self.hasClass('fht-table-init')) {
if (settings.fixedColumns > 0) {
$divHead = $('<div class="fht-thead"><table class="fht-table"></table></div>').prependTo($fixedBody);
$divHead = $('<div class="fht-thead"><table class="fht-table"></table></div>').css({
'padding-right': settings.scrollbarOffset
}).prependTo($fixedBody);
} else {
$divHead = $('<div class="fht-thead"><table class="fht-table"></table></div>').prependTo($wrapper);
$divHead = $('<div class="fht-thead"><table class="fht-table"></table></div>').css({
'padding-right': settings.scrollbarOffset
}).prependTo($wrapper);
}

$divHead.find('table.fht-table').addClass(settings.originalTable.attr('class'));
@@ -601,17 +605,6 @@
$cell.css({
'width': parseInt(cellArray[index], 10)
});

/*
* Fixed Header and Footer should extend the full width
* to align with the scrollbar of the body
*/
if (!$(this).closest('.fht-tbody').length && $(this).is(':last-child') && !$(this).closest('.fht-fixed-column').length) {
var padding = Math.max((($(this).innerWidth() - $(this).width()) / 2), settings.scrollbarOffset);
$(this).css({
'padding-right': padding + 'px'
});
}
});
},

3 changes: 2 additions & 1 deletion jquery.fixedheadertable.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.