- var n = 0;
table
thead
tr
th(colspan=3) All
tr
th(colspan=2) First two
th(rowspan=2) Third
tr
th First
th Second
tbody
while n < 128
- n++
tr
td Cell #{n}.1
td Cell #{n}.2
td Cell #{n}.3
View Compiled
:root {
--border-width: 2px;
--border-color: #CED4DA;
--border: var(--border-width) solid var(--border-color);
}
/* Sticky header */
table {
border-collapse: collapse;
border-spacing: 0;
}
thead {
position: sticky;
top: 0;
}
th, td {
border: var(--border);
}
/* Other styles */
body {
font-family: system, BlinkMacSystemFont, 'Segoe UI', Roboto,
Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', Helvetica, Arial,
sans-serif;
margin: 0;
}
table {
width: 100%;
}
th {
text-align: left;
background-color: #f1f3f5;
}
th, td {
padding: 3px 5px;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.