Is there a way to set background color conditionally ony when data is present?
Only when someone sets a time due it shows up in the column and I want to make that more visible.
I am familiar with setting a condition based on .innerHTML=
but is there way to express if a value is present apply background and if not do nothing.
Edit 1
I am using this code in a script editor currently. I want to also be able to highlight a cell under the "Time" column when it is not blank.
<script type="text/javascript" language="javascript">
var x = document.getElementsByTagName("TD");
var i=0;
for (i=0;i<x.length;i++)
{
if (x[i].className=="ms-vb2")
{
if (x[i].innerHTML=="Request")
{
x[i].style.backgroundColor="#ed2a2a";
}
if (x[i].innerHTML=="Assigned")
{
x[i].style.backgroundColor="Yellow";
}
if (x[i].innerHTML=="Arrived to Modality")
{
x[i].style.backgroundColor="Green";
}
}
}
</script>