TypeError: c is undefined

TypeError: c is undefined

hasnain_khanhasnain_khan Posts: 2Questions: 1Answers: 0

Hi, Acutally my datatables are working through out my project but not working only with this table and I see everything is correct here is my table structure and I am getting this error in the console TypeError: c is undefined

<table id="table" class="table table-striped table-bordered">
                <thead>
                <tr class="filters">
                    <th class="align-middle text-center">Photo</th>
                    <th class="align-middle text-center">Username</th>
                    <th class="align-middle text-center">Email</th>
                    <th class="align-middle text-center">Actions</th>
                </tr>
                </thead>
                <tbody>
                @if($accounts)
                    @foreach($accounts as $account)
                        @if($account->status == 'student')
                        <tr>
                            <td class="text-center align-middle">
                                <img style="border-radius: 50%;" height="100" src="{{$account->photo ? $account->photo->file :  asset('img/avatar.png')}}" alt="">
                            </td>
                            <td class="text-center align-middle">{{$account->username}}</td>
                            <td class="text-center align-middle">{{$account->username}}</td>
                            <td class="text-center align-middle">{{$account->email}}</td>
                            <td class="text-center align-middle">
                                <a href="{{route('edit_student_account', $account->id)}}">
                                    <button title="Edit" class="btn btn-primary"><span class="fas fa-pencil-alt"></span></button>
                                </a>
                                <a data-toggle="modal" data-target="#deleteRoleModal{{$account->id}}">
                                    <button title="Delete" class="btn btn-danger"><span class="fas fa-trash-alt"></span></button>
                                </a>
                            </td>
                        </tr>
                        @endif
                    @endforeach
                @endif
                </tbody>
            </table>

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,823Questions: 1Answers: 10,129 Site admin

    Thanks for your question. As noted in the forum rules, please post a link to a running test case showing the issue so we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Allan

  • allanallan Posts: 61,823Questions: 1Answers: 10,129 Site admin
    Answer ✓

    Oh also - you've got four column headers in your thead but five columns in tbody.

    Allan

  • hasnain_khanhasnain_khan Posts: 2Questions: 1Answers: 0

    haha yes that was the problem. Thank you for the answer. And sorry for the dumb question :smile:

This discussion has been closed.