Hi, I have a tab report and can color the background of a specific column based on values. If I add > or < i can only get two options.. what I want is style a specific color between two numbers and then everything else grey. Here is what I have so far.
calcfield1 > -31 specific color
calcfield1 between 2 numbers specific color (between -61 and -30)
with this script above.. anything over -31 is correct color #CC666, but everything under -30 is the #FFFF99 color.. but if the number is say -100 it is still #FFFF99. Just need help getting the between numbers working....
Any suggestions. Again, it works when I do not have the else if between.. thank you!!
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
Mikey
Hi, I have a tab report and can color the background of a specific column based on values. If I add > or < i can only get two options.. what I want is style a specific color between two numbers and then everything else grey. Here is what I have so far.
calcfield1 > -31 specific color
calcfield1 between 2 numbers specific color (between -61 and -30)
everything else grey
</div>
<script>
var isi = document.getElementById('visi[@field:MarineID]').parentNode.parentNode;
if('[@calcfield:1#]' > "-31"){
isi.querySelector('td:nth-child(8)').style.backgroundColor = '#CC6666';
isi.querySelector('td:nth-child(8)').style.color = 'white';
}
else if('[@calcfield:1#]' > "-61" || '[@calcfield:1#]' < "-30"){
isi.querySelector('td:nth-child(8)').style.backgroundColor = '#FFFF99';
isi.querySelector('td:nth-child(8)').style.color = 'black';
}
else{
isi.querySelector('td:nth-child(8)').style.backgroundColor = 'grey';
isi.querySelector('td:nth-child(8)').style.color = 'white';
}
</script>
with this script above.. anything over -31 is correct color #CC666, but everything under -30 is the #FFFF99 color.. but if the number is say -100 it is still #FFFF99. Just need help getting the between numbers working....
Any suggestions. Again, it works when I do not have the else if between.. thank you!!
Link to comment
Share on other sites
9 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.