I need to fix the position of table used as a header while scrolling. I was trying to achieving the functionality of data table to be scrolled horizontally and vertically while it's data cells width remains constant. Now the issue is whenever I try to fix the position of table that I used for header it's not scrolling with horizontal scroll. I just want to fix the top header table while scrolling vertically but it should scroll horizontally.
This is the css I have used for it
table {
line-height: 3;
border-collapse: collapse;
min-width: 100%;
display: block;
}
table td span {
white-space: normal;
line-height: 1.2;
}
table th,
table td {
padding: 0 10px !important;
line-height: 1.2;
min-width: 175px;
max-width: 175px;
}
#table1 th:first-child {
padding-left: 5px;
}
table th {
background: #f9f9f9;
}
table .table-frame {
height: 300px;
overflow-y: scroll;
}
.scroll-table-holder {
overflow-x: auto;
white-space: nowrap;
max-height: calc(100vh - 350px);
}
.text-left{
text-align: left;
}
Here's the plunker with complete html and css. On this plunker it just need the table used for header to be fixed at top while scrolling vertically