From 417bbeb33da986b7326d86103a69b4378bbabe18 Mon Sep 17 00:00:00 2001 From: Gabriel Jenik Date: Fri, 4 Dec 2015 00:51:15 -0300 Subject: [PATCH] FIX: Mixing inner and outer widths Seems CSS width property is read as inner width, but when setting, JQuery sets the outer one. With the change, we always talk about inner. --- stickyheader.jquery.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stickyheader.jquery.js b/stickyheader.jquery.js index b82272d..a4a6aa4 100644 --- a/stickyheader.jquery.js +++ b/stickyheader.jquery.js @@ -23,10 +23,10 @@ jQuery(document).ready(function ($) { stickyHeader.css('width', tableWidth); var cellWidths = []; for (var i = 0, l = headerCells.length; i < l; i++) { - cellWidths[i] = $(headerCells[i]).width(); + cellWidths[i] = $(headerCells[i]).innerWidth(); } for (var i = 0, l = headerCells.length; i < l; i++) { - $(stickyHeaderCells[i]).css('width', cellWidths[i]); + $(stickyHeaderCells[i]).innerWidth(cellWidths[i]); } var cutoffTop = $(table).offset().top;