I am working on a fixed table header where I have a scrollbar. I am taking 2 tables one on top and other on bottom. Top table will have headers (Name, Address, Phone, Details), bottom table will have all rows with details. I have to add extra width 20px to last th to sync widths of both top table and bottom table. This might not be 20px but equal to scrollbar width. What I tried is any suggestion? My table is dynamically populated.
// Adding table width to sync with scrollbar
$(document).ready(function () {
var thLastWidth = $('#fixedHeaderTable th:last').width()+18;
$('#fixedHeaderTable th:last').css('width', thLastWidth + 'px');
});