Column headers misaligned until sort
Column headers misaligned until sort
I'm seeing column headers misaligned on the initial load; then they align after first sort.
Here is a jsfiddle example, effect seems to be more dramatic when the browser window is less than full screen:
http://jsfiddle.net/dr3x/rP4qX/
This is a stripped down version of the actual code which is in a modal popup window; the code to dynamically set the height of the popup is invoked on a resize event.
The intention is for the column headers to be fixed and the rows to be scrollable.
Calling fnDraw() once the screen had been rendered seemed to workaround the issue
(Originally posted as http://datatables.net/forums/discussion/19857/column-headers-misaligned-using-sscrollx - please close that discussion as sScrollX was found to not be relevant here)
Here is a jsfiddle example, effect seems to be more dramatic when the browser window is less than full screen:
http://jsfiddle.net/dr3x/rP4qX/
This is a stripped down version of the actual code which is in a modal popup window; the code to dynamically set the height of the popup is invoked on a resize event.
The intention is for the column headers to be fixed and the rows to be scrollable.
Calling fnDraw() once the screen had been rendered seemed to workaround the issue
(Originally posted as http://datatables.net/forums/discussion/19857/column-headers-misaligned-using-sscrollx - please close that discussion as sScrollX was found to not be relevant here)
This discussion has been closed.
Replies
Allan
I will work on the example some more and see if I can strip away any of the irrelevant parts.
http://datatables.net/forums/discussion/18014/how-to-vertically-resize-datatables#Item_3
Allan
https://code.google.com/p/chromium/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Pri%20M%20Iteration%20ReleaseBlock%20Cr%20Status%20Owner%20Summary%20OS%20Modified&groupby=&sort=&id=290399
I updated it reporting that it may have resurfaced, as I am experiencing this same behavior again, but only in Chrome.
The old thread on these forums is here:
http://datatables.net/forums/discussion/17714/chrome-update-30-0-breaks-remote-bootstrap-header-column-sizing#Item_26
Looks like this might be a dead topic, but we found ourselves running into a similar column misalignment issue. Essentially, the header would sometimes be offset 15 pixels to the right. It was a frustrating problem because it was intermittent.
In the end, we are applying a bit of a hack after loading our tables (using the rows.add() function):
We found a padding-left: 15px style on the div, so the style update above resolves our misalignment problem. I can't find anywhere in the datatables js file where that style would be created, though. Still a bit of a mystery to me.