Pregunta:
Fecha: 04-06-2019 07:36:59
(En Español)
¿Cómo dejar fijos los títulos de una tabla? position:fixed[No resuelta]
hola buen dia... tengo una tabla y quiero dejar los titulos del td fijos... pero cuando le pongo position:fixed para dejarlo quieto... no me abarca toda la pantalla y el texto se me corre.. y no he podido organizarlo.<thead class="titulo"> <tr> <th>Fecha Ingreso</th> <th>Fecha Entrega</th> <th>Dias para Entregar</th> <th>Dias Atraso</th> <th>No Orden</td> <th>Estado Pedido</th> <th>Asesor</th> <th>Detalles</th> <th>Doc Entrega</th> <th>No Guia</th> <th>Transportadora</th> </tr> </thead>Votos: 1 - Respuestas: 3 - Vistas: 15 Compartir en: Google Facebook Twitter LinkedIn Link
Respuestas:
-
Fecha: 04-06-2019 11:08:40 Saludos... primero debes poner el resultado dentro de un div que sea: position:relative;
segundo, a cada td, debes darle un tamaño, al igual que en los titulos.
tercero, debes dejar un margen superior para que el primer resultado no se sobreponga en los titulos "fixed"
ejemplo:
<div class="positionabsolute"> <table class="table"> <tr class="trfixed"><th class="fecha"></th><th class="nombre"></th><th class="otracosa"></th></tr> <tr><td class="fecha">04-Jun-2019</td><td class="nombre">Ernesto</td><td class="otracosa">Texto de otra cosa</td></tr> <tr><td class="fecha">04-Jun-2019</td><td class="nombre">Anacleto</td><td class="otracosa">Mas texto</td></tr> </table> </div>
Saludos...
Stryfe™ Votos: 0 - Link respuesta -
-
Fecha: 26-06-2019 05:57:44 Primero crear Css
.tableFixHead { overflow-y: auto; height: 400px; } .tableFixHead th { position: sticky; top: 0; } /* Just common table stuff. Really. */ .TableFixeada { border-collapse: collapse; width: 100%; } th { background:#eee; }
Segundo Crear Tabla
<div class="table-responsive tableFixHead"> <table class="table table-hover table-bordered mb-0 TableFixeada"> <thead> <tr> <th><strong>ENERO</strong></th> <th><strong>FEBRERO</strong></th> </tr> </thead> <tbody> <tr> <td></td> <td></td> </tr> </tbody> </div>
Votos: 0 - Link respuesta
Para participar activamente de la comunidad primero debes autenticarte, ingresa al sistema.Iniciar Sesión