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

Fix table's within tables bug #175

Merged
merged 2 commits into from
Mar 10, 2015
Merged
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
12 changes: 6 additions & 6 deletions jquery.floatThead.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@
throw new Error('jQuery.floatThead must be run on a table element. ex: $("table").floatThead();');
}
canObserveMutations = opts.autoReflow && canObserveMutations; //option defaults to false!
var $header = $table.find('thead:first');
var $tbody = $table.find('tbody:first');
var $header = $table.children('thead:first');
var $tbody = $table.children('tbody:first');
if($header.length == 0){
throw new Error('jQuery.floatThead must be run on a table that contains a <thead> element');
}
Expand Down Expand Up @@ -234,7 +234,7 @@
var absoluteToFixedOnScroll = ieVersion <= 9 && !locked && useAbsolutePositioning; //on IE using absolute positioning doesn't look good with window scrolling, so we change position to fixed on scroll, and then change it back to absolute when done.
var $floatTable = $("<table/>");
var $floatColGroup = $("<colgroup/>");
var $tableColGroup = $table.find('colgroup:first');
var $tableColGroup = $table.children('colgroup:first');
var existingColGroup = true;
if($tableColGroup.length == 0){
$tableColGroup = $("<colgroup/>");
Expand Down Expand Up @@ -323,7 +323,7 @@

function setHeaderHeight(){
var headerHeight = 0;
$header.find("tr:visible").each(function(){
$header.children("tr:visible").each(function(){
headerHeight += $(this).outerHeight(true);
});
$sizerRow.outerHeight(headerHeight);
Expand Down Expand Up @@ -808,9 +808,9 @@
},
getRowGroups: function(){
if(headerFloated){
return $floatContainer.find("thead").add($table.find("tbody,tfoot"));
return $floatContainer.children("thead").add($table.children("tbody,tfoot"));
} else {
return $table.find("thead,tbody,tfoot");
return $table.children("thead,tbody,tfoot");
}
}
});
Expand Down