Sticky-headers: Allow nested tables in sticky header

See https://stackoverflow.com/q/48793036/145346
This commit is contained in:
Rob Garrison 2018-02-15 13:13:44 -06:00
parent 9d4cf1820d
commit f4d454a432

View File

@ -213,8 +213,8 @@
if ($stickyTable.attr('id')) { $stickyTable[0].id += wo.stickyHeaders_cloneId; } if ($stickyTable.attr('id')) { $stickyTable[0].id += wo.stickyHeaders_cloneId; }
// clear out cloned table, except for sticky header // clear out cloned table, except for sticky header
// include caption & filter row (fixes #126 & #249) - don't remove cells to get correct cell indexing // include caption & filter row (fixes #126 & #249) - don't remove cells to get correct cell indexing
$stickyTable.find('thead:gt(0), tr.sticky-false').hide(); $stickyTable.find('> thead:gt(0), tr.sticky-false').hide();
$stickyTable.find('tbody, tfoot').remove(); $stickyTable.find('> tbody, > tfoot').remove();
$stickyTable.find('caption').toggle(wo.stickyHeaders_includeCaption); $stickyTable.find('caption').toggle(wo.stickyHeaders_includeCaption);
// issue #172 - find td/th in sticky header // issue #172 - find td/th in sticky header
$stickyCells = $stickyThead.children().children(); $stickyCells = $stickyThead.children().children();