Note that there are some explanatory texts on larger screens.

plurals
  1. PODataTables fixed headers misaligned with columns in wide tables
    primarykey
    data
    text
    <h2>Problem</h2> <p>When using the <code>sScrollX</code>, <code>sScrollXInner</code> and/or <code>sScrollY</code> to achieve a fixed header table with its inner content scrolling, the headers of the table go out of alignment with the rest of the body in Chrome and IE. Firefox, on the other hand, displays them perfectly.</p> <p>Using the version 1.9.4, as far as I can tell, this issue only occurs when there is a lot of data with fluctuating widths, and with words that are very long/unwrappable combined in the same columns as small ones. Also, the table in question needs to be fairly wide.</p> <p>All these factors are demonstrated in this <a href="http://jsfiddle.net/pratik136/etL73/embedded/result/" rel="nofollow noreferrer">fiddle</a>:</p> <h2>Output</h2> <p><strong>Chrome:</strong><br> <a href="https://i.stack.imgur.com/4530R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4530R.png" alt="Chrome Screenshot"></a></p> <p><strong>IE:</strong><br> <a href="https://i.stack.imgur.com/6oCLs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6oCLs.png" alt="IE9 Screenshot"></a></p> <p><strong>Firefox</strong><br> <a href="https://i.stack.imgur.com/1ONsv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1ONsv.png" alt="Firefox Screenshot"></a></p> <h2>Suggested Solutions</h2> <p><strong>These solutions have been suggested before but have had no effect</strong> on my implementation. Owing to some of these suggestions, I setup a clean plain vanilla demo as I wanted to ensure that no other code was contributing to this effect.</p> <ul> <li>turn-off/remove all my css</li> <li><code>setTimeout( function () { oTable.fnAdjustColumnSizing(); }, 10 );</code></li> <li>calling <code>oTable.fnFilter( "x",0 )</code> and <code>oTable.fnFilter( "",0 )</code> in that order</li> <li><code>"sScrollXInner": "100%"</code></li> <li>get rid of all widths</li> </ul> <p>The only solution that I found to the misaligned headers was taking out <code>sScrollX</code> and <code>sScrollY</code>, but this can't be counted as a solution as you lose the fixed header/inner content scrolling functionality. So sadly it's a temporary hack, not a fix!</p> <h2>Note</h2> <p>To edit/play with the latest <a href="http://jsfiddle.net/pratik136/etL73" rel="nofollow noreferrer">fiddle</a>.</p> <p>I have tried various combinations which can be observed in the revision history of the fiddle by using the link <code>http://jsfiddle.net/pratik136/etL73/#REV#</code> where <code>1 &lt;= #REV# &lt;= 12</code></p> <h2>History</h2> <p><strong>StackO</strong><br> This question has been asked before: <a href="https://stackoverflow.com/questions/8607290/jquery-datatables-header-misaligned-with-vertical-scrolling">jQuery Datatables Header Misaligned With Vertical Scrolling</a><br> but the vital difference is that the OP of that question mentioned that they were able to fix the issue if all CSS was removed, which is untrue in my case, and I have tried a few permutations, thus thought the question worthy of a repost.</p> <p><strong>External</strong><br> This issue has also been flagged on the DataTables forum: </p> <ul> <li><a href="http://datatables.net/forums/discussion/7395/sscrolly-and-sscrollx-broken/p1" rel="nofollow noreferrer">http://datatables.net/forums/discussion/7395/sscrolly-and-sscrollx-broken/p1</a></li> <li><a href="http://datatables.net/forums/discussion/7778/vertical-scrolling-messes-up-column-header-alignment#Item_1" rel="nofollow noreferrer">http://datatables.net/forums/discussion/7778/vertical-scrolling-messes-up-column-header-alignment#Item_1</a></li> <li><a href="http://datatables.net/forums/discussion/3835/width-columns-problem-in-chrome-safari/p1" rel="nofollow noreferrer">http://datatables.net/forums/discussion/3835/width-columns-problem-in-chrome-safari/p1</a></li> <li>My bug report: <a href="http://datatables.net/forums/discussion/12491/datatables-header-alignment-issue-refresh#Item_1" rel="nofollow noreferrer">http://datatables.net/forums/discussion/12491/datatables-header-alignment-issue-refresh#Item_1</a></li> </ul> <p>This issue has driven me nuts! Please contribute your thoughts!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload