SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.


share|improve this question
up vote 2 down vote accepted

There is the HTML calculated column method discussed here:

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.

share|improve this answer
Looking back at this, I would say this is the best solution. Easy implementation with no undesired effects. – tehman Mar 26 '15 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! :)

share|improve this answer
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 Sep 23 '11 at 17:39
never mind, got it. Thank you :) – tehman Sep 23 '11 at 17:48
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? :) – Andrey Markeev Sep 23 '11 at 17:48
ok, very well :) – Andrey Markeev Sep 23 '11 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 Sep 26 '11 at 11:48

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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