There are likely a few things to watch out for (a minus in a text name or something like that.)
//quick cheat red if negative.
var table = document.getElementById("my_table");
for (var j=0, row; row=table.rows[j]; j++) {
for (var i=0, cell; cell= row.cells[i]; i++) {
if (cell.innerText.indexOf("-")>-1) {
cell.style.color="red";
}
}
}
var table = document.getElementById("my_table");
for (var j=0, row; row=table.rows[j]; j++) {
for (var i=0, cell; cell= row.cells[i]; i++) {
if (cell.innerText.indexOf("-")>-1) {
cell.style.color="red";
}
}
}
No comments:
Post a Comment