Hier ein Demo, wo Du ablesen kannst, wie die Rotausleuchtung funktionieren kann:
Code
<table id="machinedata">
<thead>
<tr>
<th>Maschine</th>
<th>Zeit</th>
</tr>
</thead>
<tbody>
<tr>
<td>Maschine 3</td>
<td>12</td>
</tr>
<tr>
<td>Maschine 2</td>
<td>17</td>
</tr>
<tr>
<td>Maschine 1</td>
<td>25</td>
</tr>
</tbody>
</table>
<style>
#machinedata td.low {
color: red;
}
</style>
<script>
function hightlighttime() {
var therows = machinedata.rows;
for (var i = 1; i < therows.length; i++) {
var cell = therows[i].cells[1];
cell.innerHTML = cell.innerHTML - 1; // nur zum Test
if (cell.innerHTML < 5) {
cell.classList.add("low");
}
}
}
setInterval(hightlighttime, 1000);
</script>
Alles anzeigen