updated with new code

This code will work when the tbody of table is not related to the width changes happening in thead. and also it respects the min-width, if applied.