No sorting or searching available for a table containing data

No sorting or searching available for a table containing data

walkjiveflywalkjivefly Posts: 2Questions: 1Answers: 0

This is my first foray into DataTables. I use PHP to generate an html page with a table which is fed to DataTables. When there is no data in the table the search and sort functions are available:

As soon as I have even one row in the table the search and sort functions disappear:

I thought perhaps the table was malformed but it has the required thead and tbody sections. All of the opening/closing tags are balanced.

Oddly, when there is data in the table, the DataTables debugger says it has zero rows yet I can see them onscreen. When there is no data in the table, the debugger still says there are no rows but the search box and sort buttons are displayed.

The debugger also says 15 tests for common issues found nothing wrong. The configuration data is here

The actual data is generated dynamically and the page is PHP generated but I've saved the generated html for a page with 0 rows of data in the table here and for the table with 1 row of data in the table here

Obviously I've done something stupid, but can't see what. I can't find any matching problems in the forum so it's a novel something stupid. Hopefully someone here can point out the missing semicolon or misplaced tag or whatever it is. Thank you.

Answers

  • walkjiveflywalkjivefly Posts: 2Questions: 1Answers: 0
    edited March 2020

    Finally found the obvious error! Mismatched number of columns between the thead row and the tbody row(s).

    I don't know how to mark this as the answer.

This discussion has been closed.