I am trying to change the color of a row of my html table, depending on the value of a cell, but when I update the page I observe the colors that I put them, it takes about 1 second. and these colors disappear, I'm using Chrome.
What could be happening?
PHP / HTML:
<tbody>
<?php
$array_causa_colores = array(
'Por determinar' => 'green',
'Problema con el enlace de proveedor' => 'yellow'
);
?>
<?php while($row = $resultado->fetch_array(MYSQLI_ASSOC)) { ?>
<tr class= "<?php echo $array_causa_colores[$row['causa']];?>">
<td><?php echo $row['id']; ?></td>
<td><?php echo $row['alcance']; ?></td>
<td><?php echo $row['tecnologia']; ?></td>
<td><?php echo $row['serv_afectados']; ?></td>
<td><?php echo $row['zona']; ?></td>
<td><?php echo $row['inicio']; ?></td>
<td><?php echo $row['fin']; ?></td>
<td><?php echo $row['ticket']; ?></td>
<td><?php echo $row['causa']; ?></td>
<td><?php echo $row['solicitud']; ?></td>
<td><a href="modificar.php?id=<?php echo $row['id']; ?>"><span class="glyphicon glyphicon-pencil"></span></a></td>
<td><a href="#" data-href="eliminar.php?id=<?php echo $row['id']; ?>" data-toggle="modal" data-target="#confirm-delete"><span class="glyphicon glyphicon-trash"></span></a></td>
</tr>
CSS:
.green{background-color: green;}
.yellow{background-color: yellow;}