Add columns to Bootstrap 4 example without losing sort and pagination?
Add columns to Bootstrap 4 example without losing sort and pagination?
mikegoescoding
Posts: 3Questions: 1Answers: 0
in DataTables
Using the example from: https://datatables.net/examples/styling/bootstrap4
Everything is working just fine until I try to add additional columns. The pagination and sort features disappear and I am left with just one endless table. I know I'm missing something, but I've followed the example exactly, and it works perfectly...until I add additional columns (I need 9 in total).
Any help would be much appreciated!
Answers
Usually this is a Javascript error stopping the script. Check the browser's console for errors. Likely a syntax error.
Kevin
@kthorngren Thanks for the quick reply. I do have a console error, but I'm not quite sure what it is telling me.
and the only javascript in the file is the init per the example:
$(document).ready(function () {
$('#example').DataTable();
});
I have tried adding paging: true, etc and nothing changes.
Thanks!
Is your column number in html equal to the number in datatable's initialization code?
SOLVED: there was one sneaky row that had no data in it in the new column(s) that appears to be causing the error. Thanks for your help @LukasL , @kthorngren !