Rows are broken (misaligned) (IE9, Datatables 1.9.4, FixedColumns 2.0.3)

Rows are broken (misaligned) (IE9, Datatables 1.9.4, FixedColumns 2.0.3)

yvesdyvesd Posts: 8Questions: 0Answers: 0
edited December 2012 in Bug reports
Hi there,

I have a (bug?) issue with Datatables 1.9.4 and FixedColumns 2.0.3, when displaying a big table in IE9 (in Standards mode): rows are misaligned/broken. The offset grows when scrolling down.

Live example (shortened): http://live.datatables.net/oduhil/3

Bad rendering picture : http://snag.gy/4sMnq.jpg

Complete HTML testcase here: http://pastebin.com/T0WTsSpc

Help :) - it's urgent :(

Yves D

Replies

  • yvesdyvesd Posts: 8Questions: 0Answers: 0
    edited December 2012
    (deleted comment: merged with above)
  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    Try removing the cellspacing you have on the table - that makes the cell width calculations virtually impossible. I don't have IE to hand at the moment I'm afraid so I can't try it out though.

    Allan
  • yvesdyvesd Posts: 8Questions: 0Answers: 0
    edited December 2012
    Thanks for your very fast answer, but unfortunately removing cellspacing didn't help :(

    Updated live example: http://live.datatables.net/osemob

    I don't know if it helps, but, the bug didn't reproduce if I add some characters to cells, like:
    - code: http://live.datatables.net/eparas
    - pic: http://snag.gy/i9ZXV.jpg
    but, in that case, sScrollX seems not be taken into account?!



    BTW, very nice plugin, thanks Allan!

    Yves
  • yvesdyvesd Posts: 8Questions: 0Answers: 0
    Hello again

    I found a *very nasty* fix. :p

    Altering the end of _fnEqualiseHeights (adding two pixels)


    [code]
    /* Can we use some kind of object detection here?! This is very nasty - damn browsers */
    if ( $.browser.msie && $.browser.version < 8 )
    {
    this.s.dt.oInstance.oApi._fnLog( this.s.dt, 1, "MSIE < 8");
    $(anClone[i]).children().height( iHeight-iBoxHack );
    $(anOriginal[i]).children().height( iHeight-iBoxHack );
    }
    else
    {
    this.s.dt.oInstance.oApi._fnLog( this.s.dt, 1, "Other browser or IE >= 8");
    //anClone[i].style.height = iHeight+"px";
    //anOriginal[i].style.height = iHeight+"px";
    anClone[i].style.height = iHeight+2+"px";
    anOriginal[i].style.height = iHeight+2+"px";
    }
    this.s.dt.oInstance.oApi._fnLog( this.s.dt, 1, '' + iHeight + ' / ' + anClone[i].style.height + ' / ' + anOriginal[i].style.height);
    [/code]

    This is ugly, but seem to fix the problem. What do you think of that?

    Yves
  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    Its still got cellspacing - just the default of 2, which would explain the 2 needed in your fix above. Try using `cellspacing="0"` .

    Allan
  • yvesdyvesd Posts: 8Questions: 0Answers: 0
    edited December 2012
    Still no luck forcing cellspacing to 0 in HTML: http://live.datatables.net/osemob/2

    BTW, the nasty fix works with 1 added (instead of 2) too...

    Yves Dessertine
  • yvesdyvesd Posts: 8Questions: 0Answers: 0
    edited December 2012
    I really think there is some kind of problem when getting or setting size in _fnEqualiseHeights, because, when hardcoding size to 50 pixels (waaay too small) :
    - The left column (almost empty) get resized to 50 pixels
    - The right part (with long values) don't get resized
    Hence the idea of adding 1 or 2 pixels
  • yvesdyvesd Posts: 8Questions: 0Answers: 0
    Allan, what's your opinion to the hack I made?
    Can somebody reproduce this in IE9, using the latest example? http://live.datatables.net/osemob/2
  • yvesdyvesd Posts: 8Questions: 0Answers: 0
    Maybe a pointer to the offsetHeight problem: http://webcache.googleusercontent.com/search?q=cache:h8InfPADi00J:vadikom.com/dailies/offsetwidth-offsetheight-useless-in-ie9-firefox4/+&cd=1&hl=fr&ct=clnk&gl=fr&client=firefox-a

    "So, right now in IE9 and FF4 you can get computed width/height values for block elements reported like "100.34px", "11.65px", etc."

    Yves
This discussion has been closed.