1

I've some problem using a plugin of jQuery called jScrollPane. At the moment it has a weird behaviour. It just doesn't read the whole height of the contained table. The html stucture is the following:

<div id="container-of-the-table">
<table></table>
</div>

The javascript is the following:

setupScrollPane('#container-of-the-table');

function setupScrollPane(el, options) {
    var id = (el instanceof jQuery) ? el.attr("id") : el.substring(1);
    api = $(el).jScrollPane({
        horizontalGutter: 6,
        verticalGutter: 6,
        mouseWheelSpeed: 50
    }).data("jsp");
    scrollPaneApi[id] = api;

    if (undefined != options){
        if (undefined != options.scrollToX){
            api.scrollToX (options.scrollToX);
        }
        if (undefined != options.scrollToY){
            api.scrollToY (options.scrollToY);
        }
    }
}

The css is the following:

table {
    display: block;
    height: 165px;
    width: 1080px;
}
#container-of-the-table{
    overflow:auto;
}

The content of the table is more than 1000px but the shown content (with a minimal scrollbar in the right css for the plugin) is less than 200px.

The plugin seem to be working but its not cause it lets me scroll only a minimal part of the table.

I've found a forum post with a similar problem but i couldn't understand how it's solved.

3
  • 1
    Have you tried modifying the css of the container? Maybe adding height: auto; max-height: 165px could solve the issue.
    – d_z90
    Apr 28, 2015 at 14:45
  • 1
    Yes this was the right thing to do!!! Apr 29, 2015 at 15:02
  • Nice glad to hear that! I am going to post the answer with this solution then!
    – d_z90
    Apr 29, 2015 at 15:04

1 Answer 1

1

Apparently to solve this issue, you have to modify the css of #container-of-the-table. This is the right code:

#container-of-the-table{
    overflow:auto;
    max-height: 165px;
    height: auto;
}

I am glad that my answer was helpful!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.