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

victorwvieira picture victorwvieira  路  3Comments

KKrisu picture KKrisu  路  3Comments

Mihier-Roy picture Mihier-Roy  路  3Comments

ModPhoenix picture ModPhoenix  路  3Comments

roseak picture roseak  路  3Comments