Foros del Web » Creando para Internet » CSS »

Table height no funciona

Estas en el tema de Table height no funciona en el foro de CSS en Foros del Web. Hola muchachos, para hacerlo simple: Tengo el siguiente código: @import url("http://static.forosdelweb.com/clientscript/vbulletin_css/geshi.css"); Código CSS: Ver original div #datos table {     border : 1px #F00 ...
  #1 (permalink)  
Antiguo 29/09/2011, 13:14
Avatar de Raziel_Ravenheart  
Fecha de Ingreso: agosto-2011
Ubicación: Ibagué, Tolima
Mensajes: 192
Antigüedad: 12 años, 7 meses
Puntos: 37
Table height no funciona

Hola muchachos, para hacerlo simple:

Tengo el siguiente código:

Código CSS:
Ver original
  1. div#datos table {
  2.     border: 1px #F00 solid;
  3.     width: 100%;
  4.     height: 200px;
  5. }
  6.  
  7. div#datos table thead {
  8.     width: 100%;   
  9.     height: 20px;  
  10. }
  11.  
  12. div#datos table tbody {
  13.     width: 100%;   
  14.     height: 170px;
  15.         overflow: hidden; /*esto da igual, asi le ponga auto o scroll tambien */
  16. }

Digamos que el resto de código css no es relevante, al igual tengo una tabla con

Código HTML:
Ver original
  1. <div id="datos" >
  2.         <table>
  3.         <thead>
  4.         <tr>
  5.         <th>dato 1</th><th>dato 2th><th>dato 3</th><th>dato 4</th><th>dato 5</th>
  6.         </tr>
  7.         </thead>
  8.        
  9.         <tbody>
  10.         <tr> <td>0000</td><td>aaaaaaa</td><td>bbbbb</td><td>ccccc</td><td>eeeee</td> </tr>
  11.         <tr> <td>0000</td><td>aaaaaaa</td><td>bbbbb</td><td>ccccc</td><td>eeeee</td> </tr>
  12.         <tr> <td>0000</td><td>aaaaaaa</td><td>bbbbb</td><td>ccccc</td><td>eeeee</td> </tr>
  13.         <tr> <td>0000</td><td>aaaaaaa</td><td>bbbbb</td><td>ccccc</td><td>eeeee</td> </tr>
  14.         <tr> <td>0000</td><td>aaaaaaa</td><td>bbbbb</td><td>ccccc</td><td>eeeee</td> </tr>
  15.         <tr> <td>0000</td><td>aaaaaaa</td><td>bbbbb</td><td>ccccc</td><td>eeeee</td> </tr>
  16.         <tr> <td>0000</td><td>aaaaaaa</td><td>bbbbb</td><td>ccccc</td><td>eeeee</td> </tr>
  17.         <tr> <td>0000</td><td>aaaaaaa</td><td>bbbbb</td><td>ccccc</td><td>eeeee</td> </tr>
  18.         <tr> <td>0000</td><td>aaaaaaa</td><td>bbbbb</td><td>ccccc</td><td>eeeee</td> </tr>
  19.         </tbody>
  20.         </table>
  21.         </div>

Y por más que le intento, no puedo hacer que el <tbody> se quede del tamaño que le indico, realmente las medidas que puse son solo un ejemplo, espero que me entiendan, ya busqué en el foro y solo encuentro el típico problema de
"table height='100%'", y eso no es lo que necesito, eso ya se como se hace, total yo nunca uso tablas para eso, si no para tabular datos.

Quiero saber como puedo darle un tamaño fijo a la tabla, ya que por más que la hago así, o con menos selectores, solo el de la tabla y los de <tbody> y <thead>, y cuando le agrego más filas, se alarga la tabla, sin ocultar el resto, además, también le puse el "overflow:hidden" al selector <table> y nada.

Algun consejo

Etiquetas: height, selector, table, tbody
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 03:52.