How to apply a different style to DataGrid header and table rows

0
I want the text in header to be left-aligned and the text in the table rows to be right-aligned. Currently, if I set "text-align: left;" in Appearance for each column, it applies to both the header and table rows.     Question: Is there any way to apply a different style to the header and table rows?
asked
2 answers
0

Hi Megumi,

You can add scss to your project. I see you are using mendix 8, so then you need something to compile the scss to css, see Customize Styling Using Calypso - Studio Pro 8 How-to's | Mendix Documentation

In mendix you can give a class to the datagrid you want to style (see your screenshot) and you can use this class in your stylesheets, e.g. by styling .yourclass thead {} and .yourclass tbody {}

 

Hope this helps!

answered
0

You should not use inline styling like this. Instead, add styling to the stylesheets located in the theme folder. There's plenty of documentation available on how to work with the stylesheets, so make sure to refer to those. The existing stylesheets already contain plenty of classes available to work with that you can apply to your page elements. In your case, you can add the text-left class to the column. That should align the text to the left side.

answered