sScrollY and column size
sScrollY and column size
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
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
This discussion has been closed.
Replies
[code]
/* Finally set the width's of the header and footer tables */
var iOuterWidth = $(o.nTable).outerWidth();
nScrollHeadInner.style.width = _fnStringToCss( iOuterWidth );
[/code]