Material-table: How to align data in a column?

Created on 4 Dec 2019  路  8Comments  路  Source: mbrn/material-table

I want to align the contents of a column right, but I don't want to make this column "numeric" because it's not.
I tried obvious "align" property with "right" value, but it didn't work.

wontfix

Most helpful comment

In your columns definition, add the following:

{
    title: <your column title>,
    field: <your column field>,
    cellStyle: {
        textAlign: "right"
    }
  }

All 8 comments

In your columns definition, add the following:

{
    title: <your column title>,
    field: <your column field>,
    cellStyle: {
        textAlign: "right"
    }
  }

In your columns definition, add the following:

{
    title: <your column title>,
    field: <your column field>,
    cellStyle: {
        textAlign: "right"
    }
  }

Im not able to fix the problem by using this.

Can you provide some codesandbox with your issue?

Can you provide some codesandbox with your issue?
I fixed it. As long as my edit and add form handle the currency I can just display it as a normal field with a custom render of a dollar sign

In your columns definition, add the following:

{
    title: <your column title>,
    field: <your column field>,
    cellStyle: {
        textAlign: "right"
    }
  }

this works

How can this be done on the action column?

Check out the my merged PR: #1974

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

revskill10 picture revskill10  路  3Comments

slevy85 picture slevy85  路  3Comments

bohrsty picture bohrsty  路  3Comments

jlgreene2 picture jlgreene2  路  3Comments

roseak picture roseak  路  3Comments