$(document).ready(function () {
    $('{{ '#%s'|format(table.getTableId()) }}').dataTable({{ config|raw }});
});

window.onload = function() {
    $('{{ '#%s'|format(table.getTableId()) }}').dataTable({{ config|raw }});
};

Fix bug when not loaded jquery
Fix bug when not loaded jquery