Ver Mensaje Individual
  #5 (permalink)  
Antiguo 30/09/2012, 11:15
doylelives
 
Fecha de Ingreso: junio-2008
Ubicación: Capital Federal xD
Mensajes: 1.208
Antigüedad: 15 años, 10 meses
Puntos: 35
Respuesta: positionar thead siempre arriba de tbody

Son condiciones a respetar para usar 2 plugins de jquery (datatables y otro de vertical scrolling).
el container me especifica el area donde el scrolling actua(height:60px) y su visibilidad (overflow:hidden), el scrolling solo debe mover el contenido del tbody, no el thead.
Como ves a continuacion el thead desaparece fuera del container.

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2.    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <title>tbody</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. <style type="text/css">
  7. /*<![CDATA[*/
  8. thead {
  9.     color:green;
  10.     position:absolute;
  11.     top:-13px;
  12. }
  13. tbody {
  14.     color:blue;
  15.     position:absolute;
  16.     top:0;/*este valor varia de 0 a positivos, por medio de un plugin*/
  17. }
  18. tfoot {color:red;}
  19. .container {
  20.     margin-top:100px;
  21.     position:relative;
  22.     overflow:hidden;
  23.     height:60px;
  24. }
  25. /*]]>*/
  26. </head>
  27. <div class="container">
  28. <table border="1">
  29. <tr>
  30. <th>thead</th>
  31. <th>thead</th>
  32. </tr>
  33.  
  34. <tr>
  35. <td>tbody - por defecto se ubica debajo del thead y sobre el tfoot</td>
  36. <td>tbody - por defecto se ubica debajo del thead y sobre el tfoot</td>
  37. </tr>
  38. <tr>
  39. <td>tbody</td>
  40. <td>tbody</td>
  41. </tr>
  42. </body>
  43. </div>
  44. </html>
__________________
I am Doyle please insert code.