Make the table header sticky, so that it can be read when scrolled
This commit is contained in:
parent
25fd458935
commit
93a2afc4ad
@ -120,4 +120,34 @@ table th {
|
||||
border: 1px solid black;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
table th {
|
||||
background: white;
|
||||
position: sticky;
|
||||
top: 0px;
|
||||
}
|
||||
|
||||
/* border magic for sticky header */
|
||||
/* https://stackoverflow.com/questions/50361698/border-style-do-not-work-with-sticky-position-element */
|
||||
th::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-right: 1px solid black;
|
||||
display: block;
|
||||
top: 1px;
|
||||
}
|
||||
th::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-bottom: 1px solid black;
|
||||
border-top: 1px solid black;
|
||||
display: block;
|
||||
top: -1px;
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user