cornflourblue / angu-fixed-header-table

AngularJS fixed header scrollable table directive
http://pointblankdevelopment.com.au/blog/angularjs-fixed-header-scrollable-table-directive
MIT License
67 stars 43 forks source link

Table Head and Body Align Issue #32

Open vetri776 opened 7 years ago

vetri776 commented 7 years ago

Table header and body content not aligned well when add more columns

hichamh commented 7 years ago

So I ran into the same issue, did the following: https://plnkr.co/edit/bf8KtYa4kHH94mxeU3U0?p=catalogue

chandanreddy1206 commented 7 years ago

@hichamh The link given is not working. Can you please share the code.

vicodina01 commented 7 years ago

@hichamh please share the solution.. the link is broken

ckosloski commented 7 years ago

If you copy/paste the url above that takes you to the plnkr.

ImproSnake commented 7 years ago

@vicodina01 @chandanreddy1206

I tried the suggested Solution supplied by hichamh and it doesnt work for me.

i did the following changes in angu-fixed-header-table.js :

if (tdElems) { tdElems.style.minWidth = columnWidth + 'px'; // tdElems.style.width = columnWidth + 'px'; } if (thElem) { thElem.style.minWidth = columnWidth + 'px'; // thElem.style.width = columnWidth + 'px'; } if (tfElems) { // tfElems.style.width = columnWidth + 'px'; tfElems.style.minWidth = columnWidth + 'px' }

I replaced the set Width Style Attribute with the minWidth Attribute. That worked for me.

Hope it helps