I currently have an HTML table formatted like the one below:
th.th {
position: fixed;
background-color: white;
}
th.tl {
position: fixed;
background-color: white;
}
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<table class="report" border="0" cellspacing="0">
<tbody>
// Rest of the table content... (omitted for brevity)
</table>
</body>
</html>
The issue I am facing is that the content within the td
elements is not aligning properly with the headers (th
). This has resulted in a messy layout.
I would like to reformat the HTML table so that the Table Headers stay fixed while the Table Rows remain scrollable. Any assistance on resolving this problem would be greatly appreciated.