DEV Community

Fersho Pls
Fersho Pls

Posted on

CSS tabla con filas y columnas fijas

<div class="table-sticky">
  <table>
  </table>
</div>
Enter fullscreen mode Exit fullscreen mode
.table-sticky {
    overflow-y: auto;
    max-height: 95vh;
}

.table-sticky table {
    table-layout: fixed;
    position: relative;
}

.table-sticky th {
    position: sticky;
    top: 0;
}

.table-sticky th:nth-child(1) {
    z-index: 1;
}

.table-sticky th:nth-child(1),
.table-sticky td:nth-child(1) {
    position: sticky;
    left: 0;
    background-color: white;
}

.table-sticky th,
.table-sticky td {
    background-color: white;
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay