Material-ui: Table Pagination : Header and Rows shift with pagination click

Created on 27 Apr 2020  路  7Comments  路  Source: mui-org/material-ui

  • [x ] The issue is present in the latest release.
  • [ x] I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 馃槸

When we click on the Table Pagination the headers and rows element shift horizontally with page click.

Expected Behavior 馃

The table elements should not shift their positioning with page switch.

Steps to Reproduce 馃暪

https://material-ui.com/components/tables/#custom-pagination-actions Switch between pages in the example provided to notice the behavior. Thank you.

Table docs good first issue

All 7 comments

@ankitasingh170190 Thanks for the report. What do you think of this diff? Do you want to submit a pull request? :)

diff --git a/docs/src/pages/components/tables/CustomPaginationActionsTable.tsx b/docs/src/pages/components/tables/CustomPaginationActionsTable.tsx
index 601be11f8..005000007 100644
--- a/docs/src/pages/components/tables/CustomPaginationActionsTable.tsx
+++ b/docs/src/pages/components/tables/CustomPaginationActionsTable.tsx
@@ -137,8 +137,8 @@ export default function CustomPaginationActionsTable() {
               <TableCell component="th" scope="row">
                 {row.name}
               </TableCell>
-              <TableCell align="right">{row.calories}</TableCell>
-              <TableCell align="right">{row.fat}</TableCell>
+              <TableCell style={{ width: 160 }} align="right">{row.calories}</TableCell>
+              <TableCell style={{ width: 160 }} align="right">{row.fat}</TableCell>
             </TableRow>
           ))}
           {emptyRows > 0 && (

I am trying to see if there is a way we can dynamically change the width incase we are not aware of the data we will be showing ? I will keep you updated if I find a solution for the same. Thank you.

@ankitasingh170190 Auto layout is likely something we will support in the upcoming DataGrid component @dtassone is working on.

@ankitasingh170190 Auto layout is likely something we will support in the upcoming DataGrid component @dtassone is working on.

wow that is awesome. Cannot wait for the release. I will submit a PR for this issue. Thank you.

Can I work on this?

@ankitasingh170190 are you working on this ?

@ankitasingh170190 are you working on this ?

yup. https://github.com/mui-org/material-ui/pull/20873

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TimoRuetten picture TimoRuetten  路  3Comments

mb-copart picture mb-copart  路  3Comments

ghost picture ghost  路  3Comments

FranBran picture FranBran  路  3Comments

finaiized picture finaiized  路  3Comments