I have seen countless solutions for a table with frozen columns that is scroll-able for example:
how do I create an HTML table with fixed/frozen left column and scrollable body?
but what I am after is for the scroll to be on the page (body) rather than the table or a container surrounding the table.
Edit- its just a basic HTML table that is to large to display altogether so has a horizontal scroll. The reason for having the horizontal scroll on the body of the page is so that users do not have to scroll to the bottom of the the page before being able to horizontally scroll.
.stickyCol2 tr th:nth-child(1),
.stickyCol2 tr td:nth-child(1){
position: absolute;
width: 50px;
left: 15px;
top: auto;
background-color: #fff;
}
.stickyCol2 tr th:nth-child(2),
.stickyCol2 tr td:nth-child(2){
position: absolute;
width: 60px;
left: 86px;
top: auto;
background-color: #fff;
}
<div class="stickyCol2">
<table>
<thead>
<tr>
<th>item 1</th>
<th>item 2</th>
<th>item 3</th>
</tr>
</thead>
<tbody>
<tr>
<td>item 1</td>
<td>item 2</td>
<td>item 3</td>
</tr>
</tbody>
</table>
</div>
js fiddle https://jsfiddle.net/uthz6c24/1/