Skip to content
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
17 changes: 13 additions & 4 deletions jquery.fixedheadertable.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,19 @@
*/
_isTable: function($obj) {
var $self = $obj,
hasTable = $self.is('table'),
hasThead = $self.find('thead').length > 0,
hasTbody = $self.find('tbody').length > 0;

hasTable = $self.is('table'),
hasThead = $self.find('thead').length > 0,
hasTbody = $self.find('tbody').length > 0,
createThead = $self.hasClass('nothead');

// tables without a thead
// create thead out of the first row
// if nothead class is specified
if (hasTable && !hasThead && createThead) {
$self.prepend($('<thead></thead>').append($self.find('tr:first').remove()));
hasThead = true;
}

if (hasTable && hasThead && hasTbody) {
return true;
}
Expand Down