Cell color based on content

31 views
Skip to first unread message

Slawek Gawlowski

unread,
Aug 13, 2018, 2:22:45 AM8/13/18
to TiddlyWiki
Hi is there a way to change table's cell background colour based on cell content ??

I created a small javascript to do that and it works in a normal browser but I cannot get it running in TiddlyWiki

any idea how to do this???

any advice is appreciated

here is my script

<script>
function myFirmware(){
for(var i=0, l2; l2=document.getElementsByClassName("firmware")[i]; i++){
var l2rs = l2.innerHTML;
if (l2rs !== "Y") {
l2.className += " red";
} else {
l2.className += " green";
}
}
}

</script>
Reply all
Reply to author
Forward
0 new messages