Scroller causes a single pixel Scrollbar

Scroller causes a single pixel Scrollbar

danielku15danielku15 Posts: 6Questions: 1Answers: 0

If you use Scroller with the lastest DataTables version you'll end up having a single pixel scrollbar even if there's no scrolling needed yet:

It looks like the _fnScrollDraw function calculates a wrong table height for some reason. In step 4. Clean up there's this code piece:

        if ( scrollY && scroll.bCollapse ) {
            divBodyStyle.height = _fnStringToCss( scrollY );
            var iExtra = (scrollX && tableEl.offsetWidth > divBodyEl.offsetWidth) ?
                barWidth :
            if ( tableEl.offsetHeight < divBodyEl.offsetHeight ) {
                divBodyStyle.height = _fnStringToCss( tableEl.offsetHeight+iExtra );

The last if statement causes the body to be resized a bit too much. By changing the iExtra to 1 the scrollbar disappears.

This discussion has been closed.