So I have a document library where I have a column with numerical values. Is it possible for example to color code/Highlight items in the column to green if they are less than 10, yellow if less than 20, and red if less than 50?

I'd prefer a way with least use of written code.


3 Answers 3


There is the HTML calculated column method discussed here: http://blog.pathtosharepoint.com/2008/09/01/apply-color-coding-to-your-sharepoint-lists/

And you could use JQUERY by itself, with small bits of JS.

<script src=".../jquery.js" type="text/javascript"></script>



        $Text = $("td .ms-vb2:lt(50)").css("background-color", "#FF0000");



The above is pretty simple, and would color any item in the list that has a number in it less than 50, but the concept is there.

  • Looking back at this, I would say this is the best solution. Easy implementation with no undesired effects.
    – tehman
    Commented Mar 26, 2015 at 15:15

You can easily achieve this, using SharePoint Designer and conditional formatting feature.

Just open your SharePoint designer, navigate to the document library, and under Views section, click on "AllItems.aspx".

Then, you will see the designer for view.

enter image description here

Select the particular item you want to colorize (make sure td element is selected, as it shown on the screenshot above), right-click on it and select "Conditional formatting":

enter image description here

The conditional formatting panel will appear on the left. Select "Create" => "Apply formatting...".

enter image description here

You will see now the condition criteria form.

enter image description here

Apply needed filters (you can select field name, comparison operation, and the value to compare), and then click "Set Style", and select background color.

No code at all! :)

  • this seems like it should work, but I can only get one condition to work at a time. is there a work around for this?
    – tehman
    Commented Sep 23, 2011 at 17:39
  • What do you mean one condition? In the Condition Criteria form you can specify more than one condition, and connect them with "Or"s or "And"s. Don't you see the link Click here to add a new clause, and the And/Or column on the screenshot? :) Commented Sep 23, 2011 at 17:48
  • ok, very well :) Commented Sep 23, 2011 at 17:49
  • when I do this formatting, It changes my form from being opened in a browser to being opened as an XML/infopath form. Is there a way to revert back to using a browser enabled form?
    – tehman
    Commented Sep 26, 2011 at 11:48
  • Sorry, I'm working only with SharePoint Foundation, and I definitely can't reproduce your issue and provide any solution, bcz InfoPath forms are only avaliable in SharePoint Server. So probably the best decision for further investigation for you will be to post a new question. Commented Sep 26, 2011 at 11:52

I've written an article on the various ways of achieving this. These are (in summary):

Client based

  • JavaScript: Put some JavaScript code into a Content Editor Web Part (as linked by @Jesus Shelby)
  • Designer: Use SharePoint Designer to set up Conditional Formatting (as explained by @Omlin)

Custom Field Type

  • Code it yourself: Make your own custom field type from scratch
  • Buy: Purchase a pre-made solution (naturally, I recommend our own product 'SharePoint Highlighter')

More information, links, and persuasive sales talk can be found in the article: How to do list highlighting in SharePoint

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.