List View Column need to be aligned center not left/right

marskh111
Giga Contributor

Anyone know how I can align my list view to display as centered for some columns?

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Hi Kimberly,



Take a look at Field Styles.



Define field styles


View solution in original post

8 REPLIES 8

Chuck Tomasi
Tera Patron

Hi Kimberly,



Take a look at Field Styles.



Define field styles


Field styles are specific to the field, regardless of the view. You could make the field style conditional based on the view, but it will require a bit of scripting to retrieve the view to decide whether to apply it or not. The "value" field on the field style just has to evaluate to true in the end. You can call a function to determine "is it time to do this formatting?" like this:



Value: javascript:callMyFunction(current);



This might help you get your hands on the view (sysparm_view) parameter. Community Code Snippets: Getting the User's View


Hey Chuck,



I just wanted to know if there's any option where we could actually do the same for all fields i.e. globally or may be table specific.


Instead of just specifying the properties for a single field of a table?



Thanks,
Manu


Sorry Manu. There is no global setting for field styles at this point (Istanbul). If you feel it is an important feature... I invite you to open an enhancement request! Our product managers DO listen.


Enhancement requests: Tell us how you would improve the ServiceNow product