I have Table made of divs but I am having difficulty to make it's header fix/freeze. I need to freeze the first row for the below table, here's my current code below Please let me know if you need anymore information.
<!--Table CSS-->
#tblWrapper{
max-height:100px;
overflow-y:scroll;
overflow-x:hidden;
height:auto;
width:100%;
}
.container{
display:table;
width:94%;
border-collapse: collapse;
background-color:#ececec;
margin:0px auto;
margin-bottom:1%;
}
.heading{
display:table-row;
line-height: 25px;
font-weight:bold;
padding-left:5px;
}
.table-row:nth-child(odd){
display:table-row;
position:relative;
}
.table-row:nth-child(even){
display:table-row;
background-color:white;
}
.col{
display:table-cell;
border: 1px solid #CCC;
padding-left:5px;
}
<!--Table Starts From Here-->
<div id="tblWrapper">
<div class="container">
<!--Heading of the table-->
<div id="headingDiv" class="heading">
<div class="col">ID</div>
<div class="col">Is Active </div>
<div class="col">Article Name </div>
<div class="col">Description </div>
<div class="col">Action </div>
</div>
<!--Row 1-->
<div class="table-row">
<div class="col">1</div>
<div class="col"><input type="checkbox" /></div>
<div class="col">3 tier bookshelf (Set Up)</div>
<div class="col">3 tier bookshelf (Set Up)</div>
<div class="col">Add Edit Delete </div>
</div>
<!--Row 2-->
<div class="table-row">
<div class="col">2</div>
<div class="col"><input type="checkbox" /></div>
<div class="col">3 WICK CANDLE HOLDER WITH HURRICANE</div>
<div class="col">3 WICK CANDLE HOLDER WITH HURRICANE</div>
<div class="col">Add Edit Delete </div>
</div>
<!--Row 3-->
<div class="table-row">
<div class="col">2</div>
<div class="col"><input type="checkbox" /></div>
<div class="col">3 WICK CANDLE HOLDER WITH HURRICANE</div>
<div class="col">3 WICK CANDLE HOLDER WITH HURRICANE</div>
<div class="col">Add Edit Delete </div>
<!--Row 4-->
</div><div class="table-row">
<div class="col">2</div>
<div class="col"><input type="checkbox" /></div>
<div class="col">3 WICK CANDLE HOLDER WITH HURRICANE</div>
<div class="col">3 WICK CANDLE HOLDER WITH HURRICANE</div>
<div class="col">Add Edit Delete </div>
</div>
<!--Row 5-->
<div class="table-row">
<div class="col">2</div>
<div class="col"><input type="checkbox" /></div>
<div class="col">3 WICK CANDLE HOLDER WITH HURRICANE</div>
<div class="col">3 WICK CANDLE HOLDER WITH HURRICANE</div>
<div class="col">Add Edit Delete </div>
</div>
</div>
<!--End of the Table-->
</body>
</html>