Foros del Web » Programando para Internet » PHP »

Problemas con tablas dinamicas

Estas en el tema de Problemas con tablas dinamicas en el foro de PHP en Foros del Web. No puedo lograr que en la tabla la primera fila siempre coincida en el acho de las filas que se crean segun la cantidad de ...
  #1 (permalink)  
Antiguo 20/04/2007, 12:01
Avatar de jimadri  
Fecha de Ingreso: julio-2006
Ubicación: Buenos Aires
Mensajes: 487
Antigüedad: 17 años, 9 meses
Puntos: 1
Problemas con tablas dinamicas

No puedo lograr que en la tabla la primera fila siempre coincida en el acho de las filas que se crean segun la cantidad de registros que tire mi consulta.
Les dejo el codigo esperando me puedan ayudar.
Mi idea es que la tabla tanto titulo como resultados me queden siempre al mismo ancho osea prolijo.

Código PHP:
<table width="100%" height="26"  border="0" bordercolor="#006600">
  <tr>
    <td width="128" bgcolor="#009933"><div align="center"><strong>Habitaci&oacute;n</strong></div></td>
    <td width="53" bgcolor="#009933"><div align="center"><strong>Single</strong></div></td>
    <td width="49" bgcolor="#009930"><div align="center"><strong>Doble</strong></div></td>
    <td width="47" bgcolor="#009933"><div align="center"><strong>Triple</strong></div></td>
    <td width="73" bgcolor="#009933"><div align="center"><strong>Cuadruple</strong></div></td>
    <td width="125" bgcolor="#009933"><div align="center"><strong>Family Plan </strong></div></td>
    <td width="73" bgcolor="#009933"><div align="center"><strong>Validez</strong></div></td>
    <td width="61" bgcolor="#009933"><strong>Regimen</strong></td>
  </tr>
</table>

<?
  
  
while($myrow mysql_fetch_array($result))
    {
      
         
?>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#009933" class="subtitulo">
  <tr>
    <td width="132" align="left"><? echo $myrow[desc_habitacion]; ?></td>
    <td width="57" align="center" valign="middle"><? echo $myrow[single]; ?></td>
    <td width="44" align="center" valign="middle"><? echo $myrow[doble]; ?></td>
    <td width="51" align="center" valign="middle"><? echo $myrow[triple]; ?></td>
    <td width="75" align="center" valign="middle"><? echo $myrow[cuadruple]; ?></td>
    <td width="126" align="center" valign="middle"><? echo $myrow[family_plan]; ?></td>
    <td width="75" align="center" valign="middle"><? echo $myrow[validez]; ?></td>
    <td width="65" align="center" valign="middle"><? echo $myrow1[desc_regimen]; ?></td>
  </tr>
</table>     

<?
    
    
}
     
// end while
   
  
}
  else

  {
   
?>
  #2 (permalink)  
Antiguo 20/04/2007, 12:48
Avatar de gerson  
Fecha de Ingreso: febrero-2005
Ubicación: Lima
Mensajes: 481
Antigüedad: 19 años, 2 meses
Puntos: 4
Re: Problemas con tablas dinamicas

Hola jimadri pues creo q no es necesario hacer dos tablas, seria solo con una; de la siguiente manera:
Código PHP:
 <table width="100%" height="26"  border="0" bordercolor="#006600"> 
  <tr> 
    <td width="128" bgcolor="#009933"><div align="center"><strong>Habitaci&oacute;n</strong></div></td> 
    <td width="53" bgcolor="#009933"><div align="center"><strong>Single</strong></div></td> 
    <td width="49" bgcolor="#009930"><div align="center"><strong>Doble</strong></div></td> 
    <td width="47" bgcolor="#009933"><div align="center"><strong>Triple</strong></div></td> 
    <td width="73" bgcolor="#009933"><div align="center"><strong>Cuadruple</strong></div></td> 
    <td width="125" bgcolor="#009933"><div align="center"><strong>Family Plan </strong></div></td> 
    <td width="73" bgcolor="#009933"><div align="center"><strong>Validez</strong></div></td> 
    <td width="61" bgcolor="#009933"><strong>Regimen</strong></td> 
  </tr> 
<? 
   
  
while($myrow mysql_fetch_array($result)) 
    { 
         
?> 
  <tr> 
    <td width="132" align="left"><? echo $myrow[desc_habitacion]; ?></td> 
    <td width="57" align="center" valign="middle"><? echo $myrow[single]; ?></td> 
    <td width="44" align="center" valign="middle"><? echo $myrow[doble]; ?></td> 
    <td width="51" align="center" valign="middle"><? echo $myrow[triple]; ?></td> 
    <td width="75" align="center" valign="middle"><? echo $myrow[cuadruple]; ?></td> 
    <td width="126" align="center" valign="middle"><? echo $myrow[family_plan]; ?></td> 
    <td width="75" align="center" valign="middle"><? echo $myrow[validez]; ?></td> 
    <td width="65" align="center" valign="middle"><? echo $myrow1[desc_regimen]; ?></td> 
  </tr>     

<? 
     
    

     
// end while 
     
?>
</table>
Saludos
__________________

  #3 (permalink)  
Antiguo 20/04/2007, 14:18
Avatar de jimadri  
Fecha de Ingreso: julio-2006
Ubicación: Buenos Aires
Mensajes: 487
Antigüedad: 17 años, 9 meses
Puntos: 1
Re: Problemas con tablas dinamicas

He probado tu ejemplo y funciona perfectamente, muchas gracias.
  #4 (permalink)  
Antiguo 20/04/2007, 14:28
Avatar de gerson  
Fecha de Ingreso: febrero-2005
Ubicación: Lima
Mensajes: 481
Antigüedad: 19 años, 2 meses
Puntos: 4
Re: Problemas con tablas dinamicas

De nada... Estamos para ayudar.
__________________

Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 06:27.