reactjsprimereactcodesandbox

Does anyone know why my scrolling isn't working on my datatable?


So I tried making a datatable with the "PrimeReact" Library. But it seems like the scroll function isn't working.

I've tried looking everywhere for possible solutions but couldn't find a hint. After I tried recreating this issue in a codesandbox which I did here: https://codesandbox.io/p/sandbox/compassionate-feather-kk7nv4?file=%2Findex.html%3A4%2C29

It seems like there's something missing here, but I just don't know what.

Thanks in advance.


Solution

  • Fixed: https://codesandbox.io/p/sandbox/runtime-shape-m4lky

    You were missing 3 things.

    import 'primereact/resources/themes/lara-light-indigo/theme.css';   // theme
    import 'primereact/resources/primereact.css';                       // core css
    

    And on your table you need a scrollHeight

     scrollable scrollHeight="200px"