Tema: piramide php
Ver Mensaje Individual
  #4 (permalink)  
Antiguo 01/03/2008, 23:50
maxpower2008
 
Fecha de Ingreso: diciembre-2007
Mensajes: 427
Antigüedad: 16 años, 4 meses
Puntos: 35
Re: piramide php

creo que esto es lo que quieres

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>piramide</title>
</head>

<body>
Digite numero de filas
<form action="piramide.php" method="post" >
<input type="text" name="num" value="0">
<input type="submit" value="enviar">
</form>
<?
$var=$_POST['num'];
echo"$var";
?>
<table border="1">
<?
for ($i = 1; $i <= $var; $i++) {
echo"<tr>";
for ($j = 1; $j <= $i; $j++) {
echo"<td>".$i."</td>";
}
echo"</tr>";
}
?>
</table>
</body>
</html>

dime si te sirvio.........