title: jQuery DataTables: Uncaught TypeError: Cannot read property 'mData' of undefined
body: <p>Why I'm getting error</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'mData' of undefined</p>
  </blockquote>
  
  <p>I respect the DataTables requirements (and I also read another topics about my error and I respect every answer and solution). Please help me.</p>
  
  <p>Here is my php code:</p>
  
  <pre><code>&lt;table class="table table-striped table-bordered table-hover" id="sample_1"&gt;
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;th class="table-checkbox"&gt;
                      &lt;input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes"/&gt;
                  &lt;/th&gt;
                  &lt;th&gt;
                       Utilizator
                  &lt;/th&gt;
                  &lt;th&gt;
                       Nume complet
                  &lt;/th&gt;
                  &lt;th&gt;
                       Clasa
                  &lt;/th&gt;
                  &lt;th&gt;
                       Functia
                  &lt;/th&gt;
                  &lt;th&gt;
                       E-Mail
                  &lt;/th&gt;
                  &lt;th&gt;
                       Ultima logare
                  &lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
              &lt;?
                 foreach($data["users"] as $student)
                 {
              ?&gt;
              &lt;tr class="odd gradeX"&gt;
                  &lt;td&gt;
                      &lt;input type="checkbox" class="checkboxes" value="1"/&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                       &lt;? echo $student["username"]; ?&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                       &lt;? echo " ".$student["last_name"]." ".$student["first_name"].""; ?&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                       &lt;? echo getclass($student["class"]); ?&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                       &lt;?
                       $functie = 0;
                       if($student["role"] == 1)
                       {
                           $functie = 1;
                           echo "Administrator site";
                       }
                       if($student["fctsc"])
                       {
                           $functie = 1;
                           echo "Director";
                       }
                       if($student["diriginte"])
                       {
                           $functie = 1;
                           echo "Diriginte";
                       }
                       if($student["profesor"])
                       {
                           $functie = 1;
                           echo "Profesor";
                       }
                       if($functie == 0)
                           echo "Elev";
                       ?&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;a href="mailto:&lt;? echo $student["email"]; ?&gt;"&gt;
                          &lt;? echo $student["email"]; ?&gt;
                      &lt;/a&gt;
                  &lt;/td&gt;
                  &lt;td class="center"&gt;
                       &lt;? echo $student["lastlogin"]; ?&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;?
                 }
              ?&gt;
          &lt;/tbody&gt;
      &lt;/table&gt;
  </code></pre>