Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/07/2012, 19:39
ameno123
 
Fecha de Ingreso: julio-2010
Mensajes: 158
Antigüedad: 13 años, 9 meses
Puntos: 1
De acuerdo Problema agregando HTML al codigo PHP

Hola, estoy haciendo un sistema de mensajes privados pero cuando le agrego el estilo tengo un problema, se desordena el css.


Tengo un if que se fija si hay mensajes.

Código PHP:
if ($row==$cero) {
        echo("<center><b>No tienes mensajes.</b></center>");

    } else { 

echo' <table width="600" border="0" align="center" cellpadding="1" cellspacing="1">
    <tr>
      <td width="50" align="center" valign="top"><strong>Estado</strong></td>
      <td width="50" align="center" valign="top"><strong>De</strong></td>
      <td width="50" align="center" valign="top"><strong>Asunto</strong></td>
      <td width="50" align="center" valign="top"><strong>Fecha</strong></td>
      <td width="40" align="center" valign="top"><strong>Eliminar</strong></td>
    </tr>
    
    </tr>';
$i = 0; 
    while($row = mysql_fetch_assoc($res)){ ?>
      <tr bgcolor="<?php if($row['leido'] == "si") { echo "#FFCAB0"; } else { if($i%2==0) { echo "FFA07A"; } else { echo "FFA07A"; } } ?>">
   
      <td align="center" valign="top"><? if($row['leido'] == "si") { echo'<img src="leido.png" width="35" height="35" title= "Mensaje le&iacute;do"; alt="Mensaje le&iacute;do">'; } else { if($i%2==0) { echo'<img src="no-leido.png" width="35" height="35" title= "Mensaje NO le&iacute;do"; alt="Mensaje NO le&iacute;do">'; } else { echo'<img src="no-leido.png" width="35" height="35" alt="Mensaje NO le&iacute;do">'; } } ?></td>
      <td align="center" valign="top"><?=$row['de']?></td>
      <td align="center" valign="top"><a href="leer.php?id=<?=$row['ID']?>"><?=$row['asunto']?></a></td>
      <td align="center" valign="top"><?=$row['fecha']?></td>

 
<?php $i++; 
} } 
?>

ESTILO HTML
Cuando no hay mensajes muestra todo bien, cuando tens 1 o mas se mueve todo el estilo.