I'm dealing with a table and struggling to make the CSS sticky position work. Can someone help me troubleshoot?
.table_wrapper {
width: 100%;
height: 400px;
overflow: auto;
position: relative;
}
.table_wrapper thead th {
position: -webkit-sticky;
position: sticky;
z-index: 2;
top: 0;
}
<div class="table_wrapper">
<table >
<thead>
<tr>
<th>Patient Name</th>
<th>Contact Number</th>
<th>Date/Time</th>
<th>Status</th>
<th>Duration</th>
<th>Room/Location</th>
<th>Appointment Type/Reason</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>