So I get a console error on a large set of rows that I\'m iterating from a database with php. I am initializing this with the metronic theme. As you can see I have my thead and
Number of items in array specified by columns option should match number of <td>
elements. You have 12 elements in columns array and 13 <td>
elements.
From the manual:
Note that if you use
columns
to define your columns, you must have an entry in the array for every single column that you have in your table (these can benull
if you don't which to specify any options).
Add extra object to columns
array to match number of columns in the HTML.
Alternatively you can replace columns
with columnDefs
entirely for readability.
"columnDefs": [{
"orderable": false,
"searchable": false,
"targets": [0]
}, {
"orderable": false,
"targets": [2, 3, 11, 12]
}
],
See jQuery DataTables: Common JavaScript console errors for more information on this and other common console errors.