2
I have the following problem and I believe that the JS can help, but I know almost nothing of JS.
I need the contents of the "td" tag if it equals "mount" to turn green and if it’s "wait" turn red.
<input type="text" id="search" placeholder="Buscar">
<table class="table table-dark table-hover" id="table">
<caption>Operacao</caption>
<thead>
<tr>
<th>Ativo</th>
<th>Sinal</th>
<th>Cotação</th>
</tr>
</thead>
<?php while ($linha = mysqli_fetch_assoc($result)) { ?>
<tbody>
<tr>
<td><?= $linha['ATIVO'] ?></td>
<td><?= $linha['Robo PUT'] ?></td>
<td><?= $linha['Real Time'] ?></td>
</tr>
</tbody>
<?php } ?>
</table>
I don’t think javascript is the best option to do what you want. You can apply a class (or inline styling) according to a condition in php. In which of the three
td
you want to change the color?– dfvc
The middle line, where it should be the sign.
– EDUARDO BARROS