I think this will help you: https://datatables.net/release-datatables/extensions/FixedHeader/examples/header_footer.html
In a nutshell, if you know how to create a dataTable, You just need to add this jQuery line to your bottom:
$(document).ready(function() {
var table = $('#example').DataTable();
new $.fn.dataTable.FixedHeader( table, {
bottom: true
} );
} );
bottom: true // is for making the Bottom header fixed as well.