Spacing Error

Asked

Viewed 39 times

0

Well here’s the thing, I’m developing a website for a football club, but I’m in trouble.

I intended to show 4 players of each type per line, ie in the first line showed at most 4 defenses, and if there were more defenses in the comic would go to the second line in the template.

I’m with the problem that I can’t do that, I’ve tried to give but what happens is that it all goes down instead of just going the x that I want.

Below demonstrates the link I’m talking about:

http://afdtorre.pt/plantel_juniores.php

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">&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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 only show 4 defenses for each "line" and not show that many defenses in one line?

Thank you.

1 answer

-2

Good evening. Try doing the control via css. From one size to tr then put size in td. Thus making only fit 4 td per line on tr. If the same would work with div.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.