While solutions for freezing headers have been posted before, I was never able to find a working method for freezing columns… Thanks to chatGPT and half a day’s worth of trial and error, I got it to work!
Here’s the CSS code that I have in the Custom CSS section:
/*==================STICKY HEADERS========================*/
thead {
position:sticky;
top:0px;
z-index:7;
}
/* Sticky Headers - Repeat for each table you want a Sticky Header */
/* Fixtures */
#view_518 .kn-table-wrapper {
max-height: 750px;
}
/* Operations */
#view_635 .kn-table-wrapper {
max-height: 750px;
}
/* Manager View */
#view_575 .kn-table-wrapper {
max-height: 750px;
}
/*===========Freeze first column Operations=========*/
#view_635 th:first-child,
#view_635 td:first-child {
position: sticky;
left: 0;
z-index: 6; /* Increase z-index to be higher than the header */
background-color: #f9f9f9;
border-right: 1px solid #ddd;
}
/*===========Freeze first two columns Fixtures=========*/
#view_518 th:first-child, #view_518 th:nth-child(2),
#view_518 td:first-child, #view_518 td:nth-child(2) {
position: sticky;
z-index: 6; /* Increase z-index to be higher than the header */
background-color: #f9f9f9;
border-right: 1px solid #ddd;
}
#view_518 th:first-child, #view_518 td:first-child {
left: 0;
}
#view_518 th:nth-child(2), #view_518 td:nth-child(2) {
left: calc(100px + 1px);
}