Link to home
Start Free TrialLog in
Avatar of ITimaging

asked on

'Color' field in Lists - Sharepoint


I am trying to figure out how to add a colored field in a list for Sharepoint. What I mean for this is based on a certain status for a project, I want the field to be filled with a color, like Green for On Schedule, Yellow for Behind, and Red for Immediate Attention.

So, for example:
Project #1 - Location Philly - Status: [GREEN]
Project #2 - Location NY - Status: [RED]

Hopefully this is clear enough.

Thanks for your help everyone.
Avatar of KoenVosters
Flag of Belgium image

You can use jQuery to achieve this:

Add this code in a content editor webpart

If you don't know how to put jQuery on your SharePoint site:
Avatar of TEEDA

If you have access to SharePoint Designer, you can also do this using conditional formatting. If you need a "how to", let me know.
In addition to the above references, you can also use calculated column with javascript/JQuery to achieve the same.

Here the references:

Avatar of ITimaging


I don't really have access to the server to be able to deploy JQuery to the server, unfortunately, otherwise I'd use it. I do have Sharepoint Designer 2010 for it, though. TEEDA, do you happen to still have a "how-to" for that, please?
I'm having terrible luck with this thing. Okay, so I went through and got the formatting and everything set the one time, but after getting it setup it didn't actually do anything. It didn't change the background of anything in there. Now, I thought it was my mistake since it usually is so I thought I'd start over with it - didn't save the page and re-opened it so it was fresh. Now every time I actually try and open the data view, the list appears and then disappears. I can't click on any of the fields to actually apply a format.
in your page, insert a web part zone if there isn't one there already and click Insert a dataview. Sort and filter as needed.  Select the chevron at the top right of the dataview and choose Conditional Formatting, which will open a task pane. Now select the table cell you want to color and click Create/Apply Formatting in the task pane. Create your condition and click OK. The Modify Style dialog appears, allowing you to set background color, fonts and so on. Good luck.
is it possible that you chose Hide Content instead of Apply Formatting? I've done that once or twice.
Sorry, but I did try that TEEDA, as explained in Koen's link. Unfortunately it doesn't actually change the color. It does nothing to be precise.
I did check to see if I did, and I didn't. I made sure I made everything visible.
If there are existing entries in your list that meet the conditions, then I'm mystified as to why the formatting isn't being applied.  But just in case, click the Set Visibility button in the task pane and click All Formatting Visible.
I'm baffled myself. I don't know why it's not filling it the proper colors, and I set it up so the condition is correct. I did set it for All Formatting Visible too. It's odd.
Avatar of TEEDA

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial