I\'ve a problem using DataTables. When i add colspan for the last column, the datatable plugin wont get applied to the table. If i remove the colspan for the last one and pu
dataTable does not support colspan or rowspan.
If you use a colspan, dataTable won't understand the columns count / calculation, returning undefined and throwing an error in that case.
So what we need to do, is tell dataTable that in case it doesn't get the expected result, what should be the alternative one.
For that we will use: defaultContent property, and of course expecifying the targets / affected columns.
For example: on a table with 3 td's if we use td colspan="2", we will have to set the default values for the other 2 (because one already exists - and it's the first).
Code:
"aoColumnDefs": [{
"aTargets": [2,3],
"defaultContent": "",
}]