How is data alignment set in Data Grid?

2
I am a UI designer, working to style a Mendix application. In a number of places, the app uses the Data Grid—the basic one, not Data Grid 2. All of the <th> and <td> cells are picking up a classes of “mx-right-aligned” or “mx-left-aligned” when the grid renders.  How are these classes being applied? I cannot see a place to control the alignment of the data in the grid properties. I have a theory that the data grid is adding the right alignment to numeric elements and left alignment to string elements. Is this correct? Is there any way I can override these automatic assignments?  
asked
3 answers
0

Hi Janet,

You cannot override the alignment for attribute types; strings/dates will be aligned to the left, numbers to the right. If you want to change the alignment for a number, you should change the attribute type to String or add a string attribute in your Domain Model.

As only numeric data related to size should be aligned to the right, it is fair to request control over alignment on the idea section.

answered
0

Try data grid 2 → Custom content → you can specifiy the Alignment in that and it would be easy to allign it

answered
0

For the regular data grid, select the column and add text-align:left to the Style.

answered