Well, here's the thing, I'm developing a website for a football club, but I have a problem.
I wanted to show 4 players of each type per line, ie in the first row it showed a maximum of 4 defenses, and if there were more defenses in the bd ia for the second line in the template.
I have the problem that I can not do this, I tried to give but what happens is that everything goes down, instead of just going the x that I want.
Below shows the link I'm talking about:
My Code:
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td align="center"><table width="60%" border="0" align="center" cellpadding="0" cellspacing="0" class="plantel">
<tbody>
<tr>
<?php
$sql0 = mysqli_query($link, "SELECT * from plant_juniores WHERE ordposicao='0'");
while($array0 = mysqli_fetch_array($sql0)){
?>
<td width="30"><?php echo $array0["numero"]; ?></td>
<td><img src="admin/<?php echo $array0["foto"]; ?><width="50" height="67" alt=""/></td>
<td><?php echo $array0["nome"]; ?></td>
<td>Guarda-Redes</td>
<td width="30"> </td>
<?php
}
while($array0 = mysqli_fetch_array($sql0)){
?>
<td width="30"><?php echo $array0["numero"]; ?></td>
<td><img src="admin/<?php echo $array0["foto"]; ?><width="50" height="67" alt=""/></td>
<td><?php echo $array0["nome"]; ?></td>
<td>Guarda-Redes</td>
<?php
}
?>
</tr>
<tr>
<?php
$sql1 = mysqli_query($link, "SELECT * from plant_juniores WHERE ordposicao='1'");
while($array1 = mysqli_fetch_array($sql1)){
?>
<td><?php echo $array1["numero"]; ?></td>
<td><img src="admin/<?php echo $array1["foto"]; ?><width="50" height="67" alt=""/></td>
<td><?php echo $array1["nome"]; ?></td>
<td>Defesa</td>
<td> </td>
<?php
}
while($array1 = mysqli_fetch_array($sql1)){
?>
<td><?php echo $array1["numero"]; ?></td>
<td><img src="admin/<?php echo $array1["foto"]; ?><width="50" height="67" alt=""/></td>
<td><?php echo $array1["nome"]; ?></td>
<td>Defesa</td>
<?php
}
?>
</tr>
<tr>
<?php
$sql2 = mysqli_query($link, "SELECT * from plant_juniores WHERE ordposicao='2'");
while($array2 = mysqli_fetch_array($sql2)){
?>
<td><?php echo $array2["numero"]; ?></td>
<td><img src="admin/<?php echo $array2["foto"]; ?><width="50" height="67" alt=""/></td>
<td><?php echo $array2["nome"]; ?></td>
<td>Médio</td>
<td> </td>
<?php
}
while($array2 = mysqli_fetch_array($sql2)){
?>
<td><?php echo $array2["numero"]; ?></td>
<td><img src="admin/<?php echo $array2["foto"]; ?><width="50" height="67" alt=""/></td>
<td><?php echo $array2["nome"]; ?></td>
<td>Médio</td>
<?php
}
?>
</tr>
<tr>
<?php
$sql3 = mysqli_query($link, "SELECT * from plant_juniores WHERE ordposicao='3'");
while($array3 = mysqli_fetch_array($sql3)){
?>
<td><?php echo $array3["numero"]; ?></td>
<td><img src="admin/<?php echo $array3["foto"]; ?><width="50" height="67" alt=""/></td>
<td><?php echo $array3["nome"]; ?></td>
<td>Avançado</td>
<td> </td>
<?php
}
while($array3 = mysqli_fetch_array($sql3)){
?>
<td><?php echo $array3["numero"]; ?></td>
<td><img src="admin/<?php echo $array3["foto"]; ?><width="50" height="67" alt=""/></td>
<td><?php echo $array3["nome"]; ?></td>
<td>Avançado</td>
<?php
}
?>
</tr>
<tr>
<?php
$sql4 = mysqli_query($link, "SELECT * from plant_juniores WHERE ordposicao='4'");
while($array4 = mysqli_fetch_array($sql4)){
?>
<td><?php echo $array4["numero"]; ?></td>
<td><img src="admin/<?php echo $array4["foto"]; ?><width="50" height="67" alt=""/></td>
<td><?php echo $array4["nome"]; ?></td>
<td>Treinador</td>
<td> </td>
<?php
}
while($array4 = mysqli_fetch_array($sql4)){
?>
<td><?php echo $array4["numero"]; ?></td>
<td><img src="admin/<?php echo $array4["foto"]; ?><width="50" height="67" alt=""/></td>
<td><?php echo $array4["nome"]; ?></td>
<td>Treinador</td>
<?php
}
?>
</tr>
<tr>
<?php
$sql5 = mysqli_query($link, "SELECT * from plant_juniores WHERE ordposicao='5'");
while($array5 = mysqli_fetch_array($sql5)){
?>
<td><?php echo $array5["numero"]; ?></td>
<td><img src="admin/<?php echo $array5["foto"]; ?><width="50" height="67" alt=""/></td>
<td><?php echo $array5["nome"]; ?></td>
<td>Treinador-Adjunto</td>
<td> </td>
<?php
}
while($array5 = mysqli_fetch_array($sql5)){
?>
<td><?php echo $array5["numero"]; ?></td>
<td><img src="admin/<?php echo $array5["foto"]; ?><width="50" height="67" alt=""/></td>
<td><?php echo $array5["nome"]; ?></td>
<td>Treinador-Adjunto</td>
<?php
}
?>
</tr>
</tbody>
</table></td>
How can I do just to show 4 defenses per "line" and not show that much defenses on a single line?
Thank you.