jbetancur / react-data-table-component

A responsive table library with built-in sorting, pagination, selection, expandable rows, and customizable styling.
https://react-data-table-component.netlify.app
Apache License 2.0
2.04k stars 411 forks source link

How to add pagination and Rows per page section to the top and bottom of the datatable? #1191

Open ajithv11 opened 8 months ago

ajithv11 commented 8 months ago

I have added the following code , But the pagination section is showing only on bottom, Is there any alternate method to show pagination and Rows per page section to the top and bottom of the datatable?

         <DataTable
                        title="List Products"
                        columns={columns}
                        data={products.data}
                        customStyles={customStyles}
                        noDataComponent={
                            <div className="no-datatable alert alert-warning">
                                There is no Items to show.    
                            </div>
                        }
                        highlightOnHover
                        pagination
                        paginationPosition="top" // both bottom or both
                        paginationServer
                        paginationResetDefaultPage={resetPage}
                        paginationTotalRows={products.total}
                        paginationPerPage={perPage}
                        paginationRowsPerPageOptions={[25,50,100,250]}
                        paginationComponentOptions={{}}
                        onChangePage={page => {
                            setPage(page)
                        }}
                        onChangeRowsPerPage={page => {
                            setPage(1);
                            setPerpage(page)
                        }}
                    />
douglasc0leman commented 6 months ago

paginationPosition doesn't seem to be implemented yet or am I missing it? Hoping this feature gets implemented as many would prefer the pagination at the top or to have a "both" option would be ideal.

azmatrana commented 3 weeks ago

Is there any update on this?