2
I have this code:
<?php
foreach ($controller->Lista() as $objProg) {
?>
<tr>
<td><?php echo $objProg->getplaca(); ?></td>
<td><?php echo $objProg->getmot(); ?></td>
<td><?php echo $objProg->getsaida(); ?></td>
<td><?php echo $objProg->getorig(); ?></td>
<td><?php echo $objProg->getdest(); ?></td>
<td><?php echo $objProg->getprev(); ?></td>
<td><?php echo $objProg->getcarga(); ?></td>
<td><?php echo $objProg->getadfin(); ?></td>
<td><?php echo $objProg->getagen(); ?></td>
<td><?php echo $objProg->getmal(); ?></td>
<td class="t1" ><div><?php echo $objProg->getobs(); ?></div></td>
<td><a href="edita.php?id=<?php echo $objProg->getid();?>"><p>Alterar</p></a></td>
</tr>
<?php
}
?>
I need that when the echo $objProg->getdest();
for SP paint every row of the table in one color. Any suggestions on how to do this ? I need javascript anyway or is there some other method ?
+1 for the 59th speed :D
– rray
would suggest for a space before class:
' class="...
, so if it uses PHP inline it will be more "round" the HTML, generating<td>
or<td class="...">
.– Bacco
I did that but I think my css in the tag
<tr>
I put up a!important
after the red to see, but nothing. I tested just putting<tr class="...">
without php but not going.– KevinF
Any other test I can do ?
– KevinF
Have a look http://jsbin.com/xuwacorisa/edit?html,css,output
– Marcelo Diniz
Okay, I get it. The exit is happening like this
<tr class="linha_destaque">
, but is not painting the line. I tried to use in<td>
and painted, but the line is not. I do not know what this can be.– KevinF
Are you using any other css files that have some rules for
tr
? And in this file that put the rule . highlighted line is being loaded last?– Marcelo Diniz
I tested in another table without any css just with this and it worked. I will look for the css that is preventing. Thanks for the help.
– KevinF