Scrolling table using jQuery

Is there a good and easy jQuery plugin that makes scrollable tables there.

I got one from http://www.webtoolkit.info/scrollable-html-table-plugin-for-jquery.html , but this will not work without IE and non-FF browsers.

Thanks!

+3
source share
2 answers

If you are looking for light code, skip jQuery in general and use pure HTML / CSS:

<table>
    <thead>
        <tr><th>Header Item 1</th><th>Header Item 2</th></tr>
    </thead>
    <tfoot>
        <tr><th>Footer Item 1</th><th>Footer Item 2</th></tr>
    </tfoot>
    <tbody style="overflow-y: scroll; overflow-x: hidden; height: 100px;">
        <tr><td>Item 1-1</td><td>Item 2-1</td></tr>
        ...
        <tr><td>Item 1-N</td><td>Item 2-N</td></tr>
    </tbody>
</table>

The key is to set CSS overflow in tbody to make this part scrollable (but not the whole table). You also need to set the height so that you can determine how tall the scrollable section is.

+6

Source: https://habr.com/ru/post/1703768/


All Articles