Galera...td legal?
Uma duvida basica...mas q nao to conseguindo elaborar...
Como eu posso fazer um array q no resultado as cores das linhas da tabela fiquem alternando...??
Obrigado!
Linhas Com Cores Diferentes
Started By tony, 30/05/2007, 02:39
5 replies to this topic
#1
Posted 30/05/2007, 02:39
#2
Posted 30/05/2007, 07:25
#3
Posted 30/05/2007, 09:12
Amigo fiz uma gambi aqui e funcionou pra mim.
if ($cortabela == 1){ echo "<tr bgcolor='f0f0f0'>"; $cortabela = 2; }else{ echo "<tr>"; $cortabela = 1; }
"Não há maior demonstração de insanidade do q fazer a mesma coisa, da mesma forma, dia após dia, e esperar resultados diferentes"
MCP .NET WebApplications C#
MCP SQL Server 2000
Desenvolvedor Delphi/PHP
MCP .NET WebApplications C#
MCP SQL Server 2000
Desenvolvedor Delphi/PHP
#4
Posted 30/05/2007, 11:38
vai lá:
flws..
$corA = '#EEEEEE'; $corB = '#FFFFFF'; $sel = mysql_query("SELECT * FROM table "); while($reg = mysql_fetch_array($sel)){ $cor = $cor == $corA ? $corB : $corA; //aqui voce vai imprimir as linhas certo print '<tr bgcolor="'.$cor.'"><td>'.$reg['id'].'</td></tr>'; }//fim whileeu uso assim
flws..
#6
Posted 30/05/2007, 14:41
Eu falei que era gambi
"Não há maior demonstração de insanidade do q fazer a mesma coisa, da mesma forma, dia após dia, e esperar resultados diferentes"
MCP .NET WebApplications C#
MCP SQL Server 2000
Desenvolvedor Delphi/PHP
MCP .NET WebApplications C#
MCP SQL Server 2000
Desenvolvedor Delphi/PHP
0 user(s) are reading this topic
0 membro(s), 0 visitante(s) e 0 membros anônimo(s)