can i ignore the dataTables warning about not supported rowspan / colspan?

can i ignore the dataTables warning about not supported rowspan / colspan?

some_codersome_coder Posts: 4Questions: 0Answers: 0
edited November 2013 in General
Hello,
I am using DataTables 1.8.1 with jQuery 1.6.1. I created a table with some colspans. The DataTables plugin is used because of the pagination feature (so that multiple big tables can be reduced to some tables with "only" 20 records). Problem is that i got the following warning in Firebug:

[quote]DataTables warning: Unexpected number of TD elements. Expected 72 and got 49. DataTables does not support rowspan / colspan in the table body, and there must be one cell for each row/column combination.[/quote]

I use only the pagination stuff (no sorting, no filter...). Can i just ignore this message or will there be problems with some browsers? Our customer shouldn't get some messageboxes telling him that there is some kind of error. I am asking because i already got some messages like "colVis not supported" (if i recall it correctly).

The code is server side generated. Depending on the content the first two columns will be combined via colspan. Here is a Code example. I already had to do a workaround for the "there are more columns in the thead than in the tbody"-message.

http://live.datatables.net/oqisux/4/edit#javascript,html

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Short answer is "no"... DataTables does not support colspan / rowspan in the tbody due to the complications that they cause, hence the warning. There is no workaround for this as such a feature would need to be embedded into DataTables core.

    Allan
  • some_codersome_coder Posts: 4Questions: 0Answers: 0
    Can i ignore this warning or will there be some kind of messagebox? I will ignore it if the logmessage on the firebug console is the only hint.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    You could modify DataTables to remove the warning. But I don't understand why you would want to do that - the error is there for a reason - DataTables will not function correctly with colspan /rowspan in the tbody.

    Allan
  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    [quote]I already had to do a workaround for the "there are more columns in the thead than in the tbody"[/quote]

    The best "workaround" would be to generate a standards-compliant HTML table.
This discussion has been closed.