Era per non postare l'intero codice in PHP
Codice PHP:
echo "
<table id = 'tab'>
<caption id='cap'>Clienti ordinati per </caption>
<thead><tr>
<th id='col'>ID Cliente</font> </th>
<th id='col'>Ragione Sociale</font> </th>
<th id='col'>Nome</font> </th>
<th id='col'>Cognome</font> </th>
<th id='col'>Telefono</font> </th>
<th id='col'>Cellulare</font> </th>
<th id='col'>Via</font> </th>
<th id='col'>Civico</font> </th>
<th id='col'>Paese</font> </th>
<th id='col'>Provincia</font> </th>
<th id='col'>CAP</font> </th>
<th id='col'> Codice Fiscale</font> </th>
<th id='col'>Partita Iva</font> </th>
<th id='col'>Sito Web</font> </th>
</tr></thead>
";
$a = 1;
foreach($dbh->query($sql) as $row){
if( $a % 2 == 0){
echo "<tr id ='riga'>
<td id='pari'>".$row['id_cliente']."</td>";
echo "<td id='pari'>".$row['ragione_sociale']."</td>";
echo "<td id='pari'>".$row['nome']."</td>";
echo "<td id='pari'>".$row['cognome']."</td>";
echo "<td id='pari'>".$row['telefono']."</td>";
echo "<td id='pari'>".$row['cellulare']."</td>";
echo "<td id='pari'>".$row['via']."</td>";
echo "<td id='pari'>".$row['civico']."</td>";
echo "<td id='pari'>".$row['paese']."</td>";
echo "<td id='pari'>".$row['provincia']."</td>";
echo "<td id='pari'>".$row['cap']."</td>";
echo "<td id='pari'>".$row['cf']."</td>";
echo "<td id='pari'>".$row['pi']."</td>";
echo "<td id='pari'>".$row['sito']."</td></tr> ";
}
else {
echo "<tr id ='riga'>
<td id='dispari'>".$row['id_cliente']."</td>";
echo "<td id='dispari'>".$row['ragione_sociale']."</td>";
echo "<td id='dispari'>".$row['nome']."</td>";
echo "<td id='dispari'>".$row['cognome']."</td>";
echo "<td id='dispari'>".$row['telefono']."</td>";
echo "<td id='dispari'>".$row['cellulare']."</td>";
echo "<td id='dispari'>".$row['via']."</td>";
echo "<td id='dispari'>".$row['civico']."</td>";
echo "<td id='dispari'>".$row['paese']."</td>";
echo "<td id='dispari'>".$row['provincia']."</td>";
echo "<td id='dispari'>".$row['cap']."</td>";
echo "<td id='dispari'>".$row['cf']."</td>";
echo "<td id='dispari'>".$row['pi']."</td>";
echo "<td id='dispari'>".$row['sito']."</td></tr> ";
}
$a++;
}
echo"
</table>
";
il css é sempre lo stesso ti posto tutto perchè a questo punto penso che ci sia qualche regola che interferisce per il tuo codice mi va:
Codice:
body { background-color: ghostwhite; margin:0px; }
#tab{
border:1px solid #a2a3a2;
border-radius:10px;
-moz-border-radius:10px;
-webkit-border-radius:10px;
margin:10px;
padding:2px;
margin-left:auto;
margin-right:auto;
box-shadow: 10px 10px 5px #dedede;
}
#cap{
color: blue;
font-size:large;
font-weight: bold;
text-transform:uppercase;
margin:8px;
}
#col,#pari,#dispari { color:#363636;
padding:.4em;
}
#col{ background:#5C443A;
color:#FFFFFF;
padding:3px 10px 3px 10px;
text-align:left;
text-transform:uppercase;
}
#pari{
background-color:#fff;
}
#dispari{
background-color:#D3E4E5;
}
riga:hover{
background-color:blue;}
input {
background: #363636;
border: 1px solid #323232;
color: #fff;
height: 30px;
line-height: 30px;
width: 1%;
padding: 0 10px;
}