diff --git a/src/jquery.scrollTableBody-1.0.0.js b/src/jquery.scrollTableBody-1.0.0.js index f5bf274..cb91210 100644 --- a/src/jquery.scrollTableBody-1.0.0.js +++ b/src/jquery.scrollTableBody-1.0.0.js @@ -23,8 +23,12 @@ var existingClasses = table.attr('class'); var existingMarginBottom = table.css('margin-bottom'); table.css('margin-bottom', 0); - var rowHeight = table.find('tbody tr:first').outerHeight(); - var tableHeight = rowHeight * options.rowsToDisplay; + + var tableHeight = 0; + var rows = table.find('tbody tr:lt(' + options.rowsToDisplay.toString() + ')'); + $.each(rows, function () { + tableHeight += $(this).outerHeight(); + }); var headerTable = $('