Header ColSpan is not working for me
Header ColSpan is not working for me
ccadwell
Posts: 2Questions: 1Answers: 0
Can anyone help I can't believe I found a bug with datatables I must be doing something wrong. I have posted a working example. http://live.datatables.net/dijoresu/1/
Seems on the initial load of the dom table paging and info doesn't display but if I click on one of the headers to sort the table they appear.
This discussion has been closed.
Answers
https://datatables.net/examples/basic_init/complex_header.html
Look at the example. You're missing the "rowspan" for your "test" header.
I didn't give a good example. What I was trying to do is have the first four headers to not display any headers since each row in the table body the first 4 <td> will have links within but for the example I just added blank <td> which showed the symptom.
To correct I just dropped the colspan and and added 4 <th> instead and used the coldefs in the dom to eliminate column sorting for the first 4 columns.
Here is and example of my fix http://live.datatables.net/bemaxawe/1/ not sure if this is the best way but it works.
This is the correct thing to do in DataTables. Each column must have a unique header cell (i.e. a cell that is attributed to only that column).
This is a restriction that I hope to ease in future, but doing so will be fairly complicated!
Allan