search

Home  >  Q&A  >  body text

How to adjust the height of DataTable PrimeReact

I cannot stretch the table to the full height of the block even with one record

I'm using PrimeReact in my app and this is my code:

<DataTable
                value={dataArr}
                headerColumnGroup={headerGroup}
                paginator
                rows={1}
                rowsPerPageOptions={[10, 25, 50]}
                rowHover
                responsiveLayout="scroll"
                showGridlines
                stripedRows
                resizableColumns
                
            >
....
            </DataTable>

P粉323050780P粉323050780299 days ago446

reply all(1)I'll reply

  • P粉501007768

    P粉5010077682024-03-29 14:33:57

    Because you are using responsiveLayout="scroll", you want to set scrollHeight="200px" or whatever height you want.

    Example:https://codesandbox.io /s/boring-star-jvzoei?file=/src/demo/DataTablePaginatorDemo.js

    reply
    0
  • Cancelreply