Yet another colspan issue...

Yet another colspan issue...

Gremlyn1Gremlyn1 Posts: 14Questions: 0Answers: 0
edited September 2009 in Bug reports
At least it isn't a big one! :) I'm on to my third site using dataTables now, btw, and I still love it!

I have a table that has 4 cells, and 5 columns of data under those, the last is set to colspan=2. The table works just fine when there is data in it, but when I have no data in the table the "No matching records found" message only spans 4 columns total, not 5.

Again, not a big deal, but I'm a perfectionist like that ;) I assume it's a counting function somewhere that needs to be modified a little.

Replies

  • allanallan Posts: 61,453Questions: 1Answers: 10,055 Site admin
    HI Gremlyn1,

    Actually this is intentional. In DataTables each column (in this case you have 5) needs a 'unique' TH element (this can span multiple rows, but cannot span multiple columns) in order for it to be registered as a column. Otherwise how can you activate sorting on that specific column? I think due to the complexities involved in what would be needed to fix this (questions such as, are there 4 or 5 filtering columns, would need to be answered) this is unlikely to be addressed in the near future.

    One way around it is to have two rows, and ensure that each column has a unique TH element: http://datatables.net/examples/advanced_init/complex_header.html

    Regards,
    Allan
  • Gremlyn1Gremlyn1 Posts: 14Questions: 0Answers: 0
    Makes perfect sense, guess it was wishful thinking to hope for a quick fix. I guess you probably would have done it by now if there was. I'll just make sure that table always has data and it can't bother me ;) Thanks for all your hard work Allan!
This discussion has been closed.