우선적으로 table , thead , tbody , tr , th ,td
가 필요하다 .
.container {
height: 500px;
overflow: auto;
}
.fixedHeader {
position: sticky;
top: 0;
}
<div class='container'>
<table>
<thead>
<tr>
<th class='fixedHeader'>No.</th>
<th class='fixedHeader'>Name</th>
<th class='fixedHeader'>Dept</th>
<th class='fixedHeader'>Email</th>
<th class='fixedHeader'>Expired</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>jakdu</td>
<td>프론트</td>
<td>sory</td>
<td>Y</td>
</tr>
(...중략)
이런식으로 고정을 할수가 있다 .