Complex header : Using a colspan=2 breaks the whole Datatable
Complex header : Using a colspan=2 breaks the whole Datatable
cyrille.duverne
Posts: 4Questions: 0Answers: 0
Link to test case: Removed
Debugger code (debug.datatables.net): epezac
Error messages shown: "Uncaught TypeError: oCol is undefined"
Description of problem:
Whenever I try to use a colspan in the thead section, the code breaks and an extra <th> is added to the code.
I followed this doc : https://datatables.net/examples/basic_init/complex_header.html
Could you please help ?
I'm not a huge Js expert...
Replies
You defined 6
th
tags for the header. Datatables sees this as 6 columns not 7 because of thecolspan
:The table has 7 columns of data:
One option is to create two
th
tags for the Action column, like this:Removed
The other option is to combine the Action elements into one cell, like this:
Removed
Also you should create the
tbody
. The closingtr
tag for each row should be</tr>
. See my note in the above code snippet.The HTML docs provide the Datatables requirements for the HTML table.
Kevin
Great ! Thanks Kevin !
Some of the data in the bin aren't supposed to be public, would you mind removing them please ?
I don't have access to remove them but asked Allan to. He should respond to this thread when done.
Kevin
Done now.
Allan
Wonderful ! Thanks !
Kevin, could you also remove X's name and the URL in the last 2 fields from the snippet ?
Cheers !
Also done.
Thanks Allan !