Ver Mensaje Individual
  #4 (permalink)  
Antiguo 30/09/2012, 10:25
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: positionar thead siempre arriba de tbody

Cita:
Iniciado por doylelives Ver Mensaje
mmm esto me dió una idea. poner al thead en absolute, y darle un top negativo (-100px) y por ende ubicarlo por encima del tbody con top 0, el cual solo varia siempre en un rango entre 0 y los positivos.

Pero me surgió otra duda, como un plugin necesita aplicar overflow:hidden al div contenedor de toda la table, el thead queda arriba por fuera del container y oculto =\
Siendo este el posicionamiento por defecto

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 {color:green}
  9. tbody {color:blue;}
  10. tfoot {color:red;}
  11. /*]]>*/
  12. </head>
  13. <table border="1">
  14. <tr>
  15. <th>thead</th>
  16. <th>thead</th>
  17. </tr>
  18. <tr>
  19. <td>tfoot</td>
  20. <td>tfoot</td>
  21. </tr>
  22. <tr>
  23. <td>tbody - por defecto se ubica debajo del thead y sobre el tfoot</td>
  24. <td>tbody - por defecto se ubica debajo del thead y sobre el tfoot</td>
  25. </tr>
  26. <tr>
  27. <td>tbody</td>
  28. <td>tbody</td>
  29. </tr>
  30. </body>
  31. </html>

sigo sin entender el objetivo final de tu planteo.
Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.