I am building a html table with > 100 rows, for what I'd like the table head to stay visible. The user should have the possibility to resize the cells via mouse click in the frontend; As seen here.
I've tried to use display: block to fix the first row.
But when I use JavaScript to resize the table, all th from thead show up within width of first column of tbody. It's probably related to the absolut-position in JS.
table thead tr {
display: block;
position: relative;
}
table tbody {
display: block;
overflow: auto;
width: 100%;
height: 200px;
}
For now users can only adjust size of th, which is per default shrinked to the width of first column from tbody. I'd like the user to click anywhere in the table to change the whole column-width, th and td; the first row (thead) has to be always fixed and visible.