6
My table is created with a PHP loop. I do this by PHP even adding a condition or has some better shape?
if ($nomSenha == 'xxxxxxxx') {
echo '<table class="pesquisaClientes">';
echo '<tr>';
echo '<td class="id">Id</td>
<td class="nome">Nome</td>
<td class="endereco">Endereço</td>
<td class="bairro">Bairro</td>
<td class="numero">Número</td>
<td class="complemento">Complemento</td>
<td class="telefone">Telefone</td>
<td class="email">Email</td>
<td class="data">Data</td>
<td class="editar">Editar</td>';
echo '</tr>';
$i = 0;
while ($clientes = mysql_fetch_array($selecionarClientes, MYSQL_NUM)) {
$i += 1;
echo '<tr id="cliente'.$i.'">';
echo '<td class="id">'.iconv('ISO-8859-1','UTF-8',$i).'</td>
<td class="nome">'.iconv('ISO-8859-1','UTF-8',$clientes[2]).'</td>
<td class="endereco">'.iconv('ISO-8859-1','UTF-8',$clientes[1]).'</td>
<td class="bairro">'.iconv('ISO-8859-1','UTF-8',$clientes[3]).'</td>
<td class="numero">'.iconv('ISO-8859-1','UTF-8',$clientes[4]).'</td>
<td class="complemento">'.iconv('ISO-8859-1','UTF-8',$clientes[5]).'</td>
<td class="telefone">'.iconv('ISO-8859-1','UTF-8',$clientes[6]).'</td>
<td class="email">'.iconv('ISO-8859-1','UTF-8',$clientes[7]).'</td>
<td class="data">'.iconv('ISO-8859-1','UTF-8',$clientes[8]).'</td>
<td class="editar"> Editar </td>';
echo '</tr>';
}
Before testing, is this css3? I need you to support old browsers.
– Joao Paulo
From IE9 up this CSS is supported. Check out: http://caniuse.com/#feat=css-sel3
– andremw
@Joaopaulo You can add CSS3 support on IE8 with Selectvizer. If it works for your case, it’s nice to use the
:nth-child
for being web standard. =)– elias
Thanks to all the answers. But the important thing is that users can see the best way without worrying about version! So I will initially use the php condition itself.
– Joao Paulo