Cores alternadas na tabela
Ae pessoal, to com um esquema aqi de cores alternadas pra tabela, o problema é q ta um loop dentro do outro, as cores estao ficando alternadas, mas as informações tao ficando repetidas. Se tem 5 registros, vai aparece os 5 e 5x cada um deles..
alguem sabe como arrumar?
<table width="100%" border="1" align="center" cellpadding="2" cellspacing="2" class="titulo-tabela">
<tr>
<td width="5%" height="10%" align="center" nowrap bgcolor="#316AC5" class="odd" td><strong class="titulo-tabela style1 style1">Código</strong></td>
<td width="5%" height="10%" align="center"nowrap bgcolor="#316AC5" class="titulo-tabela" td><span class="style1"><strong>Ramo</strong></span></td>
<td width="5%" height="10%" align="center"nowrap bgcolor="#316AC5" class="titulo-tabela" td><span class="style1"><strong>Bairro</strong></span></td>
<td width="5%" height="10%" align="center"nowrap bgcolor="#316AC5" class="titulo-tabela" td><span class="style1"><strong>Cidade</strong></span></td>
<td width="5%" height="10%" align="center"nowrap bgcolor="#316AC5" class="titulo-tabela" td><span class="style1"><strong>Horário</strong></span></td>
<td width="5%" height="10%" align="center"nowrap bgcolor="#316AC5" class="titulo-tabela style1" td><strong>Curso</strong> <?php while ($row_oportunidades = mysql_fetch_assoc($oportunidades)) { ?> </td>
</tr>
<?php
for($i = 0;$i<$totalRows_oportunidades;$i++) {
if(($i % 2) == 1) $fundo="#EBEBEB";
else $fundo="#CCCCCC";
?>
<tr bgcolor="<?php echo $fundo;?>">
<?php //echo mysql_result($result,$i,"estado");?>
<td width="5%" align="center" nowrap class="texto-tabela"><a href="veroportunidade.php?id_oportunidade=<?php echo $row_oportunidades['id_oportunidade']; ?>" class="texto-tabela"><?php echo $row_oportunidades['cod']; ?></a></td>
<td width="5%" align="center" class="texto-tabela"><a href="veroportunidade.php?id_oportunidade=<?php echo $row_oportunidades['id_oportunidade']; ?>" class="texto-tabela"><?php echo convertem (strtolower($row_oportunidades['ramoAtividade']),1); ?></a></td>
<td width="5%" align="center" class="texto-tabela"><a href="veroportunidade.php?id_oportunidade=<?php echo $row_oportunidades['id_oportunidade']; ?>" class="texto-tabela"><?php echo convertem (strtolower($row_oportunidades['bairro']),1); ?></a></td>
<td width="5%" align="center" nowrap class="texto-tabela"><a href="veroportunidade.php?id_oportunidade=<?php echo $row_oportunidades['id_oportunidade']; ?>" class="style1"><?php echo convertem (strtolower($row_oportunidades['cidade']),1); ?></a></td>
<td width="5%" height="39" align="center" class="texto-tabela" td><a href="veroportunidade.php?id_oportunidade=<?php echo $row_oportunidades['id_oportunidade']; ?>" class="style1"><?php echo convertem (strtolower($row_oportunidades['horario']),1); ?></a></td>
<td width="5%" align="center" class="style1" ><a href="veroportunidade.php?id_oportunidade=<?php echo $row_oportunidades['id_oportunidade']; ?>" class="texto-tabela"><?php echo convertem (strtolower($row_oportunidades['curso']),1); ?></a></td>
</tr>
<?php } }?>
</table>Discussão (5)
Carregando comentários...