Ver Mensaje Individual
  #3 (permalink)  
Antiguo 30/08/2011, 13:10
Avatar de IsaBelM
IsaBelM
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 5.032
Antigüedad: 15 años, 10 meses
Puntos: 1012
Respuesta: posicionar <td>

aquí te dejo dos maneras de hacerlo
Cita:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; http-equiv="Content-Type" charset=utf-8"/>
<title></title>
</head>
<body>
<?php
$total_registros_encontrados = 52;

for ($j = 0 ; $j < $total_registros_encontrados; $j+=5) {
$temp .= " " .$j;
}

$arreglo = explode(" ", trim($temp));
$arr = Array();
for ($x = 0; $x< sizeof($arreglo); $x++) {
$arr[$x] = $arreglo[$x];
}
?>

<table border="1">
<tr>

<?php
for ($i = 1; $i <= $total_registros_encontrados; $i++) {
echo "<td>" .$i. "</td>";

// ==== Se puede hacer de
// -------- Esta manera
if ($i % 5 == 0) {
echo "</tr><tr>";
}
// ------
// ------ O de esta otra
//$cad = "\$valores=\$i == " .implode(" || \$i == ", $arr).";";
//eval($cad);
//if ($valores) {
//echo "</tr><tr>";
//}
// ---------
// ==============
}
?>
</tr>
</table>
</body>
</html>