How can I change background color of a list or rows?

jamesgb
Kilo Explorer

Hello,

How can I change background color of a list or rows?

It is possible to change the color of a field by right clicking the field and creating a new style. But it changes that particular fields style and it is not visible when I show the entire list.

How can I change a list's background color? Or how can I change the color/background color/style of the rows in a list?

Mehmet.

---

3 REPLIES 3

Karthik Reddy T
Kilo Sage

Hello Mehmet,



Do you mean the background colors in the lists?   You should be able to add a system property called css.list.row.even.background.color and css.list.row.odd.background.color, leave the type as string and then give it a hex code in the value field.   I will say this seems to be sort of..inconsistant though when i was playing about with it, some users weren't seeing the new colors even after clearing their local cache and doing a cache dump in the instance.   Try it in a test instance or one of the ServiceNow demo instances if you want and see if that's what you wanted.



Background color of a particular row of Incident List View



How to change the list layout bg color based on condition


Karthik Reddy T.
ServiceNow Commnunity MVP -2018 class.

Rajesh Mushke
Mega Sage

Hello Mahmet,




Field styles are not displayed in list view when the Value field is left empty


Description


When defining a field style, if you leave the Value field blank, the style is presented only in the form view instead of both the form view and list view.


Steps to Reproduce


  1. Log in to a demo instance.
  2. Navigate to System UI > Field Styles and click New.
  3. Create two new styles with the following values, and click Submit after creating each one.Style 1:
    Table: incident
    Field name: number
    Value: javascript:true
    Style: background-color:purple
    Style 2:
    Table: incident
    Field name: caller
    Value: <Leave blank>
    Style: background-color:purple
  4. Check the fields in the list view and the form view and note that the list view style is applied only when the Value field is populated.


Workaround

Within the field's Style text box, insert a simple default line of CSS code like the following example:


text-align: left



Please Refer :ServiceNow KB: Field styles are not displayed in list view when the Value field is left empty (KB058...




Thanks,
Rajashekhar Mushke
Rising star : 2022 - 2024
Community Leader -2018
Connect me on LinkedIn : Rajashekhar Mushke

Thank you Rajesh and Karthik.



When I put a value while creating a new style, then the style goes completely. When I make the value field empty, the style comes back. I think there is something buggy here.



karthikvibeus I want to change the background color of a partucular list, not all lists.