Even if I wholeheartedly concur with the remarks made below your query! as a fast fix (that requires no learning curve!) If your tables have fewer than 10.000 rows, you can create a straightforward HTML table using a for/while loop, just like you would for a straightforward table. then give datatable your table's ID as follows:
$(document).ready(function() {
$('#example').DataTable();
});
I hope this helps you.