Ver Mensaje Individual
  #3 (permalink)  
Antiguo 11/05/2014, 16:08
Avatar de pzin
pzin
Moderata 😈
 
Fecha de Ingreso: julio-2002
Ubicación: Islas Canarias
Mensajes: 10.488
Antigüedad: 21 años, 9 meses
Puntos: 2114
Respuesta: Poner scroll vertical

Una solución con los tamaños de las celdas fijos sería usar thead y tbody y ponerle a este último el overflow, así aparentemente la cabecera queja fija con respecto al cuerpo.

Código HTML:
Ver original
  1.  
  2.   <thead>
  3.     <tr>
  4.       <th></th>
  5.       <th></th>
  6.       <th></th>
  7.       <th></th>
  8.     </tr>
  9.   </thead>
  10.  
  11.   <tbody>
  12.     <tr>
  13.       <td></td>
  14.       <td></td>
  15.       <td></td>
  16.       <td></td>
  17.     </tr>
  18.     <tr>
  19.       <td></td>
  20.       <td></td>
  21.       <td></td>
  22.       <td></td>
  23.     </tr>
  24.     <!-- [etc...] -->
  25.   </tbody>
  26.  

Código CSS:
Ver original
  1. table {
  2.   display: table;
  3.   width: 100%;
  4. }
  5.  
  6. table thead, table tbody {
  7.   float: left;
  8.   width: 100%;
  9. }
  10.  
  11. table tbody {
  12.   overflow: auto;
  13.   height: 150px;
  14. }
  15.  
  16. table tr {
  17.   width: 100%;
  18.   display: table;
  19. }
  20.  
  21. table th, table td {
  22.   width: 25%;
  23. }

Hay que poner algún ajuste más para que funcione bien.