Has anyone found a method to implement a sticky first column in Angular Material using CSS?
Check out the editable Stackblitz code here.
I attempted to modify this approach from https://jsfiddle.net/zinoui/BmLpV/, but encountered issues where the first column was displaced from the table and lost its styling.
<div class="zui-wrapper">
<div class="zui-scroller">
<table class="zui-table">
<thead>
<tr>
<th class="zui-sticky-col">Name</th>..........
</tr>
</thead>
<tbody>
<tr>
<td class="zui-sticky-col">DeMarcus Cousins</td>
.......
<tr>
</tbody>
</table>
</div>
</div>
.zui-scroller {
margin-left: 141px;
overflow-x: scroll;
overflow-y: visible;
padding-bottom: 5px;
width: 300px;
}
.zui-table .zui-sticky-col {
border-left: solid 1px #DDEFEF;
border-right: solid 1px #DDEFEF;
left: 0;
position: absolute;
top: auto;
width: 120px;
}