How to use datatable with table rowspan inside foreach laravel

Viewed 11

Anyone know how to use datatable with format table like this

table

My data table can't use with format table like that. My code for show data

<table id="table-rekap" class="table table-bordered">
                            <thead>
                                <tr>
                                    <th class="text-center" style="width: 20%;">No</th>
                                    <th class="text-center" style="width: 20%;">Unit Kerja</th>
                                    <th>Jenis Kendaraan</th>
                                    <th>Total</th>
                                </tr>
                            </thead>
                            @php $no = 1; @endphp
                            <tbody>
                                @foreach($rekapUnker as $unitKerja => $jenisKendaraan)
                                <tr>
                                    <td class="text-center" rowspan="9">{{ $no++ }}</td>
                                    <td class="text-center" rowspan="9">{{ $unitKerja }}</td>
                                    @foreach($jenisKendaraan as $jenKen => $total)
                                    <tr>
                                        <td>{{ $jenKen }}</td>
                                        <td>{{ $total }}</td>
                                    </tr>
                                    @endforeach
                                </tr>
                                @endforeach
                            </tbody>
                        </table>

Id table rekap for call data table

0 Answers
Related