I am trying to create an HTML page with a table that spans the entire body and displays scrollbars when needed for both horizontal and vertical scrolling.
Here is my current styling for the table:
table {
box-shadow: inset 0 0 10px #000;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
overflow: auto;
}
<table>
<tr>
<td>test</td>
</tr>
</table>
The issue I'm facing is that by default, a table column will adjust its width based on content. I want to maintain this behavior while enabling horizontal scrolling for too many columns and vertical scrolling for too many rows. The box shadow represents the edges of the table, which I want to always be at least 100% of the viewport with scrollbars if it exceeds this size.
However, as shown in the example, the table does not span the entire viewport. Any ideas on what I might have done wrong?