Despite adding height and width adjustments in the table tag and setting the overflow properties to 'auto', the table still overflows. Attempting to follow this, it doesn't seem to work with my code. Any assistance in identifying mistakes or missing elements in the code would be greatly appreciated.
<style>
table {
max-width: 600px;
max-height: 400px;
border-spacing: 0;
display: block;
}
tbody {
overflow-y: auto;
overflow-x: auto;
}
th {
/*display: block;*/
border: 1px solid #293033;
position: sticky;
top: 0;
text-align: center;
padding: 8px;
color: #e9ecef;
background-color: #1e2324;
font-weight: 500;
font-size: 14px;
}
td {
background-color: #041230;
border: 1px solid #293033;
text-align: center;
padding: 8px;
color: #e9ecef;
min-width: 150px;
font-size: 13px;
word-spacing: 2px;
}
td:nth-child(1) {
min-width: 50px;
max-width: 50px;
font-weight: bold;
color: #66FCF1;
}
</style>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="resCSS.css">
<script src="https://rawgit.com/kimmobrunfeldt/progressbar.js/1.0.0/dist/progressbar.js"></script>
<script src="https://cdn.fancygrid.com/fancy.min.js"></script>
<div class="container">
<table class="tablecolor2">
<!-- class="tablecolor" -->
<thead>
<tr>
<th>#</th>
<th>Dummy</th>
<th>dvfdgdg</th>
<th>fvfdgfd/fdgdg</th>
<th>Cdumm</th>
<th>sdfdgds</th>
<th>Cd</th>
<th>Ankjfdksf</th>
<th>jnknk</th>
<th>fdfdgdfg</th>
</tr>
</thead>
<tbody>
... (content continues)
</tbody>
</table>
</div>
https://i.sstatic.net/t9XOB.png https://i.sstatic.net/mUExR.png