JSFiddle - React, Tailwind, and code Playground

HTML

<div id="con">
	<table>
		<thead>
			<tr>
				<th>Header 1</th>
				<th>Header 2</th>
				<th>Header 3</th>
			</tr>
		</thead>		
		<tbody>				
		</tbody>
	</table>
</div>

CSS

#con{
		max-height:300px;
		overflow-y:auto;
	}
	thead tr:first-child {
	    background-color:#00f;
	    color:#fff;
	    position:absolute;
	}
	tbody tr:first-child td{
		padding-top:28px;
	}

JavaScript

$(document).ready(function(){
		for(var i=0; i<100; i++){
			$("tbody").append("<tr><td>HaHa!</td><td>HaHa!</td><td>HaHa!</td></tr>");
		}
	});