Reputation: 2153
I have created this datatable:
<script type="text/javascript">
$(document).ready(function() {
const table1 = $('#songs').DataTable({
searching: false,
paging: false
});
});
</script>
but when I click on the header nothing happens
http://45.79.248.19:8080/songs
Upvotes: 1
Views: 1882
Reputation: 11975
From your code:
<tbody>
<tr>
<th>BPM</th>
<th>ARTIST</th>
<th>ALBUM</th>
<th>LABEL</th>
<th>SONG</th>
</tr>
...
You are putting your th
inside tbody
. That's the problem. You need to put your th
in thead
tag because it allows DataTables to know what should be used for the column headers and the click-to-order controls.
More info here.
Upvotes: 1