Material-ui: [minor] Typography caption alignment in TableCell not working as expected

Created on 18 Aug 2019  路  3Comments  路  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 馃槸

<Typography variant="caption" align="center" /> inside <TableCell /> does not align to center, but <Typography variant="body2" align="center" /> does.

Expected Behavior 馃

Both should align to center as expected regardless of the variant.

Steps to Reproduce 馃暪

<TableCell>
  <Typography variant="caption" align="center">
    left aligned, unexpected
  </Typography>
</TableCell>
<TableCell>
  <Typography variant="body2" align="center">
    center aligned, correct
  </Typography>
</TableCell>

Context

Just trying to align stuff, a solution that worked is to override root theme for TableCell.

Not sure if this is by design, also I think its also present in variant="overline"

const theme = createMuiTheme({
  overrides: {
    MuiTableCell: {
      root: {
        textAlign: null,
      },
    },
  },
});

Your Environment 馃寧

| Tech | Version |
| ----------- | ------- |
| Material-UI | v4.?.? |
| React | 16.9.0 |
| Browser | 74.0.3729.169 |

support

All 3 comments

馃憢 Thanks for using Material-UI!

We use the issue tracker exclusively for bug reports and feature requests, however,
this issue appears to be a support request or question. Please ask on StackOverflow where the
community will do their best to help. There is a "material-ui" tag that you can use to tag your
question.

If you would like to link from here to your question on SO, it will help others find it.
If your issues is confirmed as a bug, you are welcome to reopen the issue using the issue template.

Tip: check the display mode.

try adding component="div" to Typography.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sys13 picture sys13  路  3Comments

rbozan picture rbozan  路  3Comments

iamzhouyi picture iamzhouyi  路  3Comments

ghost picture ghost  路  3Comments

mattmiddlesworth picture mattmiddlesworth  路  3Comments