My req: I have a column called status and I want to set the colors to the columns values based and not the entire row.

So if status is 'approved' then set the approved value to color green..etc. I followed the link below to set the colors to the items in the list.


but the selector '.ms-vb2' is check for all the column value in the list. So even if the other columns have a value called 'approved this deal'..It might also color this field. How to avoid it

  • 1
    Why don't you open the list in SharePoint designer and use conditional formatting to set 'approved status' to green Jan 8, 2016 at 21:26
  • I was just looking through this thread and was wondering the same thing. Unless I'm missing something, there's no reason to jump directly into jquery, especially with MOSS. Conditional formatting should suit your needs perfectly. Jan 8, 2016 at 23:33

2 Answers 2


I have a list that uses jQuery to change the value in columns like this

enter image description here

Here is the jQuery

<script type="text/javascript">

$Text = $("td.ms-cellstyle.ms-vb2:contains('Gold')");
$Text.css("color", "#ff993a");
$Text.css("font-weight", "bold");


I have included jQuery in my master page and then I added a script editor webpart to the page where the list is

hope this helps


Check this out: http://blog.pathtosharepoint.com/2008/09/01/apply-color-coding-to-your-sharepoint-lists/

Basically the idea is to create a calculated column that will output some HTML with some inline CSS (e.g. <div style="background-color:X"> or <span style="color:X">). The X color is calculated upon the Status column via nesting IF formula or similar approach.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.