Column mis-alignment with auto table layout and horizontal scrollbar

Column mis-alignment with auto table layout and horizontal scrollbar

tjain1981tjain1981 Posts: 4Questions: 0Answers: 0
edited December 2012 in Bug reports
I was trying to use datatable in my application and run into this issue. My table has around 25 columns and has automatic layout (not fixed).

Problem is when sort any column, table get re-align. Same can be seen on following url - http://jsfiddle.net/tjain/2myVm/embedded/result/

Problem is there when i am using horizontal scrollbar.

Replies

  • tjain1981tjain1981 Posts: 4Questions: 0Answers: 0
    I looked into the problem and found that it could be fixed by making a single line change in _fnScrollDraw method.

    It seems like in automatic layout table is not giving importance to width style. So even when width style is applied on table, column resize itself to minimum content widget of the column which breaks sub-subsequent code computations.

    This could be fixed if we add following line
    nSizer.style.width = _fnStringToCss( aApplied.shift() );

    after -
    nSizer.style.minWidth =nSizer.style.width;

    both for headers and footers
  • akhilanandakhilanand Posts: 3Questions: 0Answers: 0
    I am also facing the same issue. Is this fix going to be included into the next version of data-tables?
  • sapansaxenasapansaxena Posts: 4Questions: 0Answers: 0
    Hey I am also facing the same problem since a long time.
    Whenever I try using horizontal and vertical scrollbars(both) with a large dataset, I get misalignment problems
    I would try your fix out and see if it works.
This discussion has been closed.