Ver Mensaje Individual
  #4 (permalink)  
Antiguo 11/10/2016, 12:58
Avatar de Iballa
Iballa
 
Fecha de Ingreso: marzo-2013
Mensajes: 107
Antigüedad: 11 años, 1 mes
Puntos: 6
Respuesta: Insertar tabla en php




A la tabla le doy estilos de border solid black, a table, y me salen tal y como sale en la imagen que he puesto arriba, pero el servidor me envia la table debajo de la multiplición, aunque yo he metido dentro el php. Yo creo que se puede dejar sin el td.

Este es el código entero.

Código HTML:
<!DOCTYPE html>
<head>
	<meta charset="UTF-8">	 
	<style>
       #container
       {   
       	   width:400px;
       	   height:400px;
       	   margin:  0 auto;
       	   background: lightgrey;
       	   text-align:center;
       }
       table
       {
           border: 5px solid black;
       }
	</style>
</head>
<body> 
	<div id="container">    
      <?php
      echo '<table>';            
          for ($i=1; $i <= 10; $i++) { 
                  echo '<tr>';

                  $sol = 5 * $i;
                  echo "5 x ".$i." = ".$sol;

                  echo "<br/>";
                  echo '</tr>';
          }
        echo '</table>';
       ?>
	</div>
</body>
</html>






Gracias por las respuestas. A ver si alguien sabe el por qué de este comportamiento.