How to build a table with jquery without mData error ?

How to build a table with jquery without mData error ?

IVI4TIVI4T Posts: 1Questions: 1Answers: 0
edited May 2016 in Free community support

Hello,
I'm trying to build my table with jquery but I always have mData error.
Here is an example :
https://jsfiddle.net/koemmpLt/1/

I don't understand what is the diffrence between the examples any idea ?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 64,090Questions: 1Answers: 10,569 Site admin
    Answer ✓

    Your generated HTML is invalid - there is no tr element being used in the header using:

    thead.append( $('<tr/>')
      .append('<th>col1</th>')
      .append('<th>col2</th>')
    );
    

    Fixes it.

    Allan

This discussion has been closed.