So what is the issue?
In addition, if you are using JQuery DataTables, they're very strict with table formatting and you'll need to define a thead element as well as your tbody to have it work properly.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi guys this is my database structure:-
dayofweek subject_id start_time end_time
1 1 (some_time) (some_time)
1 2 (some_time) (some_time)
1 3 (some_time) (some_time)
1 4 (some_time) (some_time)
2 1 (some_time) (some_time)
and so on till dayofweek is 7
Here is my index.blade.php
<div class="panel-body">
<table class="table table-bordered table-striped {{ count($timetable) > 0 ? 'datatable' : '' }} dt-select">
<tbody>
<tr>
<th style="width: 10px">Day</th>
<th>Timetable</th>
</tr>
<tr>
// There will be a loop here for showing dayOfWeek(it will show from Monday to Sunday)
<td>{{$timetable->dayOfWeek}}</td>
// Here I want to loop only the subjects which exist for that particular dayOfWeek as a Button
<td>
<div class="btn-group" style="margin:5px;">
<button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{$timetable->subject_id}} - {{$timetable->start_time}} -> {{$timetable->end_time}}</button>
<div class="dropdown-menu">
<a class="dropdown-item">Edit</a>
<a class="dropdown-item">Delete</a>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
Here is the image of how I want it to look like(ignore the add button) https://imgur.com/a/LIOANng
Please or to participate in this conversation.