From 96e908ccf7b96183fa6ee0722b86e465a23add12 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Wed, 19 Nov 2014 23:46:52 +0530 Subject: [PATCH] Update jquery.fixedheadertable.js Adding support for including caption element if present in the table --- jquery.fixedheadertable.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jquery.fixedheadertable.js b/jquery.fixedheadertable.js index 1d052d8..e17264e 100644 --- a/jquery.fixedheadertable.js +++ b/jquery.fixedheadertable.js @@ -64,6 +64,7 @@ setup: function () { var $self = $(this), self = this, + $caption = $self.find('caption'), $thead = $self.find('thead'), $tfoot = $self.find('tfoot'), tfootHeight = 0, @@ -135,7 +136,11 @@ .addClass(settings.originalTable.attr('class')) .attr('style', settings.originalTable.attr('style')); - $thead.clone().appendTo($divHead.find('table')); + if ($caption) { + $caption.add($thead).clone().appendTo($divHead.find('table')); + } else { + $thead.clone().appendTo($divHead.find('table')); + } } else { $divHead = $wrapper.find('div.fht-thead'); }