i am getting this error
i am getting this error
umaeswara
Posts: 83Questions: 16Answers: 0
DataTables warning: table id=DataTables_Table_0 - Incorrect column count. For more information about this error, please see https://datatables.net/tn/18
can you please suggest, the remedy.
thanks,
Uma-
Answers
i dont have any header in my table.
here is the table
Unnamed: 0 439
company One1
Price 436.23
Change% 4.34
if I want to add table header using my js file, but this js file is used by many other tables.
how to check table which doesnt have deader and add an invisible table header. i was thinking columnDerfs with visible false, and th cells as first row. is that possible, if so how?
The
columns.title
option can be used to create table headers but hey won't be hidden. However you could use CSS to hide them.You can create them in HTML and use something like
style="display: none;"
or better CSS to hide theth
.Or you can use Javascript to jQuery methods to add the headers to the table before initializing Datatables. Use Stack Overflow to find the method that works for your situation.
This will hide the whole column not just the header.
Kevin
Ok, thanks. I used java method to append header cells.
if ($("table thead").length === 0) { ... } if anyone interested to solve similar problem.
BTW, for the question if JS is common for all the tables which are in different pages.
var table = $("table").DataTable({ ..... });
inside this can I check table id etc? table data conditions to set some columnDefs ?
thanks,
Uma-
Inside the configuration object no. Outside yes. Here is one way of doing it:
Allan
thanks, let me try and come back. I have several tables and each have different kind of options.