DataTables: Uncaught TypeError: Cannot read property 'mData' of undefined

I want to display table using DataTable in my page :

<table id="example" class="display" cellspacing="0" width="100%">
    <thead>
        <tr>
            <th>Username</th>
            <th>Firstname</th>
            <th>Lastname</th>
            <th>Phone</th>
            <th>Password</th>
            <th></th>
        </tr>
    </thead>
    <tfoot>
       <tr>
            <th>Username</th>
            <th>Firstname</th>
            <th>Lastname</th>
            <th>Phone</th>
            <th>Password</th>
            <th></th>
            <th></th>
        </tr>
    </tfoot>
    <tbody>
        <c:forEach items="${users}" var="user" varStatus="status">
            <tr>
                <form>
                    <td class="text-center">${user.getUsername()}</td>
                    <td class="text-center">${user.getFirstname()}</td>
                    <td class="text-center">${user.getLastname()}</td>
                    <td class="text-center">${user.getPhone()}</td>
                    <td class="text-center">${user.getPassword()}</td>
                </form>
                <td class="text-center"><button class="btn btn-user"   onclick="show('block','${user.getUsername()}')">Delete</button></td>
                <td class="text-center"><button class="btn btn-user" onclick="show2('block','${user.getFirstname()}','${user.getLastname()}','${user.getUsername()}', '${user.getPhone()}','${user.getPassword()}')">Edit</button></td>
            </tr>
      </c:forEach>
    </tbody>
</table>

But I get error: Uncaught TypeError: Cannot read property 'mData' of undefined

How can I solve this problem ?


ANSWERS:


I solved my probem : missing <th></th> in <thead>



 MORE:


 ? Uncaught TypeError: Cannot read property 'mData' of undefined at jquery.dataTables.yadcf.min.js
 ? Uncaught TypeError: Cannot read property 'next_page' of undefined
 ? Uncaught TypeError: Cannot read property 'textContent' of undefined
 ? Vue Resource - Post multiple data
 ? Vue Resource - Post multiple data
 ? Vue Resource - Post multiple data
 ? Laravel 5 database query retrieve first table data but not in other table
 ? Laravel 5 database query retrieve first table data but not in other table
 ? Laravel 5 database query retrieve first table data but not in other table
 ? query join 3 tables on laravel