[Solved] how to set datatable in modal?


Please try this:

$('.modal-body').append('<table class="table datatable" id="dataTables-example">'+
'<thead>'+
    '<tr>'+
        '<th>ID</th>'+
        '<th>Pelapor</th>'+
        '<th>Waktu</th>'+
        '<th>Judul</th>'+
        '<th>Kategori</th>'+
        '<th>Status</th>'+
        '<th>Publish</th>'+
        '<th>Detail</th>'+
    '</tr>'+
'</thead>'+
'<tbody>'+
    laporan+
'</tbody>');

$('#dataTables-example').DataTable();

Here is a working solution

1

solved how to set datatable in modal?