sScrollY and column size

sScrollY and column size

nababnabab Posts: 4Questions: 0Answers: 0
edited September 2011 in General
Hi,

When the vertical scroll is on, my header's size is messed up, as it's wider than its parent: the div with class "dataTables_scrollHeadInner" is 974px while the table within it is 991px.

So I looked in the code, and replaced this:

[code]
/* Finally set the width's of the header and footer tables */
var iOuterWidth = $(o.nTable).outerWidth();
nScrollHeadTable.style.width = _fnStringToCss( iOuterWidth );
nScrollHeadInner.style.width = _fnStringToCss( iOuterWidth+o.oScroll.iBarWidth );
[/code]

With that:

[code]
/* Finally set the width's of the header and footer tables */
var iOuterWidth = $(o.nTable).outerWidth();
if ( o.oScroll.sY !== "" )
{
nScrollHeadTable.style.width = _fnStringToCss( iOuterWidth-o.oScroll.iBarWidth );
}
else
{
nScrollHeadTable.style.width = _fnStringToCss( iOuterWidth );
}
nScrollHeadInner.style.width = _fnStringToCss( iOuterWidth );
[/code]

I don't know what to think as it seems to work fine in the demo here, but for me it's only working since I made that change.

Thanks to let me know what you think about this issue.

Thomas

Replies

  • nababnabab Posts: 4Questions: 0Answers: 0
    edited September 2011
    And actually, since I use also sScrollX, removing the lines about nScrollHeadTable.style.width works better:

    [code]
    /* Finally set the width's of the header and footer tables */
    var iOuterWidth = $(o.nTable).outerWidth();
    nScrollHeadInner.style.width = _fnStringToCss( iOuterWidth );
    [/code]
This discussion has been closed.