Home > Software engineering >  how to add string text rowsPerPageOptions in mui Table Pagination?
how to add string text rowsPerPageOptions in mui Table Pagination?

Time:06-02

Anyone can help me ? please check the below image i want to change the 10 from to 10 page per. whenever i select 10 20 or 30 i want to get something like 20 per page 30 per page . please check image one

This below image is the example of what actually i want. please check image two

guys i have read the whole table pagination api documentation but i couldnt get it. please check the image three

please check the code snapshot now. enter image description here

enter image description here

CodePudding user response:

Based on the docs, the rowsPerPageOptions can handle an array of objects

rowsPerPageOptions Array<number | { label: string, value: number }>

means u can use like:

...
count={10}
rowsPerPageOptions={[
   { label: "10 per page", value: 10 },
   { label: "20 per page", value: 20 },
]}
rowsPerPage={rowsPerPage}
...
  • Related