Slimscroll not working in table td

341 Views Asked by At

I have a table with one of the td with huge content so I want to have a max-height with a slim scrollbar. I have used the package https://github.com/kamlekar/slim-scroll

<td>
  <pre id="body">huge content....</pre>
</td>


<script>

new slimScroll(document.getElementById("body"), {
    'scrollBarClass': 'scrollcustom'
});

</script>

But this is not working, it overlapes all the tr and gives a slimscroll bar for entire table area.

How do I only apply slimscrollbar for td ?

1

There are 1 best solutions below

3
t.. On

jquery might get it done for you like this by selecting that id

<script type="text/javascript">
      $(document).ready(function(){
        $("#body").slimScroll({
            scrollBarClass: 'scrollcustom' 
        });
      });
    </script>