I blogged on this a while back using a similar approach for MOSS 2007. Here is a link to that post: https://www.saltypc.com/?p=99
Things have changed since then so here are the steps to set this up in 2013.
You will need to reference jquery for this to work. I prefer to download the minified script and place it in a centralized location inside my farm.
- Add a script editor web part to the bottom of your page.
- Insert the following into your source:
Modify the Change Me to reflect the column name of your list/library. You can also change the color to any web safe color of your choice.
To highlight mulitple column choices, simply copy the $Text line and past it below the copied line.
$Text = $(“td.ms-cellstyle.ms-vb2:contains(‘Column A)”); $Text.parent().css(“background-color”, “#FFFFFF”);
$Text = $(“td.ms-cellstyle.ms-vb2:contains(‘Column B)”); $Text.parent().css(“background-color”, “#000000”);
This comes in handy when you need to find a needle in a haystack.
2 thoughts on “Highlight a list/library line item”
Hello, I noticed that if you sort any of the columns in the list or library, the color highlighting disappears. Is it just me or does this happen for you too?