Mostrar dos noticias en 1 fila con 2 columnas
Publicado por Gonzalo Leonardo (2 intervenciones) el 13/01/2007 18:48:43
ESTA PROGRAMACION MUESTRA EL RESULTADO DE LAS NOTICIAS PERO UNA ABAJO DE LA OTRA.
PERO YO LO QUE NECESITO ES SABER COMO SE HACE PARA QUE POR FILA ME MUESTRE DOS NOTICIAS.
EJEMPLO DEL 1ER CASO:
noticia 1
noticia 2
...
noticia n
EJEMPLO DEL 2DO CASO, QUE NO SE COMO SE HACE:
noticia 1 noticia 2
noticia 3 noticia 4
... ...
noticia n noticia n+1
<?
if ($cant > 0)
{
while($registro = mysql_fetch_array($resultado)){
?>
<table width="100%" border="0" cellpadding="5" cellspacing="0">
<tr>
<td colspan="3"><? echo "<font size='3'><b><i>".$registro["titulo"]."</i></b></font>";?></td>
</tr>
<tr>
<td colspan="3"><? echo "<font size='2'></i>".$registro["subTitulo"]."</i></font>";?></td>
</tr>
<tr>
<td colspan="2"><img src="images/<? echo $registro['imagen']; ?>"></td>
<td width="69%">
<? $var= explode(" ", $registro['descripcion']);
for ($i=0; $i<=49; $i++){ echo "<font size='1'>".$var[$i]." "."</font>";}
?>...<font size="1"><a href="index2.php?noticia=<? echo $registro['id']; ?>">La Noticia Continua cliqueando este Link</a></font> </td>
</tr>
<tr>
<td width="16%"><? echo "<font size='1'>".$registro["fechaCreacion"]."</font>";?></td>
<td width="15%"><? echo "<font size='1'>".$registro["autor"]."</font>";?></td>
<td><? echo $registro["link"];?></td>
</tr>
</table>
<? }
}
else {echo "No hay Noticias Nuevas en la sección";}
?>
PERO YO LO QUE NECESITO ES SABER COMO SE HACE PARA QUE POR FILA ME MUESTRE DOS NOTICIAS.
EJEMPLO DEL 1ER CASO:
noticia 1
noticia 2
...
noticia n
EJEMPLO DEL 2DO CASO, QUE NO SE COMO SE HACE:
noticia 1 noticia 2
noticia 3 noticia 4
... ...
noticia n noticia n+1
<?
if ($cant > 0)
{
while($registro = mysql_fetch_array($resultado)){
?>
<table width="100%" border="0" cellpadding="5" cellspacing="0">
<tr>
<td colspan="3"><? echo "<font size='3'><b><i>".$registro["titulo"]."</i></b></font>";?></td>
</tr>
<tr>
<td colspan="3"><? echo "<font size='2'></i>".$registro["subTitulo"]."</i></font>";?></td>
</tr>
<tr>
<td colspan="2"><img src="images/<? echo $registro['imagen']; ?>"></td>
<td width="69%">
<? $var= explode(" ", $registro['descripcion']);
for ($i=0; $i<=49; $i++){ echo "<font size='1'>".$var[$i]." "."</font>";}
?>...<font size="1"><a href="index2.php?noticia=<? echo $registro['id']; ?>">La Noticia Continua cliqueando este Link</a></font> </td>
</tr>
<tr>
<td width="16%"><? echo "<font size='1'>".$registro["fechaCreacion"]."</font>";?></td>
<td width="15%"><? echo "<font size='1'>".$registro["autor"]."</font>";?></td>
<td><? echo $registro["link"];?></td>
</tr>
</table>
<? }
}
else {echo "No hay Noticias Nuevas en la sección";}
?>
Valora esta pregunta


0