Unable to get property 'mData' of undefined or null reference

Unable to get property 'mData' of undefined or null reference

baggisterbaggister Posts: 6Questions: 1Answers: 0

Using Bootstrap 3.3.7
Using latest version of jquery 3.4.1
I get this exception when running $("#mytableid").DataTable() from within $(document).ready
I've definitely got a proper table with thead, tr in head, tbody, etc
Any suggestions?
Thanks

Replies

  • kthorngrenkthorngren Posts: 20,299Questions: 26Answers: 4,769

    I believe this error is typically due to some issue with the HTML table. While it might be a valid HTML table we would need to confirm that it is supported by Datatables. Make sure all rows have the same number of columns and they match the number of columns in the thead. Make sure none of the rows have colspan or rowspan. Review the HTML requirements.

    If this doesn't help then we will need to see a link to your page or a test case replicating the issue.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • baggisterbaggister Posts: 6Questions: 1Answers: 0
    edited October 2019

    I'm sorry to say you got it right straight away. Number of columns in header incorrect. Apologies, and thank you.

This discussion has been closed.