<table border="1">
    <thead>
        <tr>
            <td style="border: 1px solid #000000;"><strong>No</strong></td>
            <td style="border: 1px solid #000000;"><strong>Kode Kelompok</strong></td>
            <td style="border: 1px solid #000000;"><strong>Kategori PMW</strong></td>
            <td style="border: 1px solid #000000;"><strong>Fak.</strong></td>
            <td style="border: 1px solid #000000;"><strong>Nama</strong></td>
            <td style="border: 1px solid #000000;"><strong>NIM</strong></td>
            <td style="border: 1px solid #000000;"><strong>Ketua/Anggota</strong></td>
            <td style="border: 1px solid #000000;"><strong>Email Ketua</strong></td>
            <td style="border: 1px solid #000000;"><strong>Judul Proposal</strong></td>
            <td style="border: 1px solid #000000;"><strong>Dosen Pembimbing</strong></td>
            <td style="border: 1px solid #000000;"><strong>Email Dosen Pembimbing</strong></td>
            <td style="border: 1px solid #000000;"><strong>Link Proposal</strong></td>
            <td style="border: 1px solid #000000;"><strong>Status {{ $jenis_monev }}</strong></td>
            <td style="border: 1px solid #000000;"><strong>Nilai Akhir</strong></td>
        </tr>
    </thead>
    <tbody>
        @php
            $no = 1;
            $tempKode = '';
        @endphp
        @foreach ($list_proposal as $proposal)
            {{-- @if($tempKode != $proposal['kode']) --}}
                <tr>
                    <th rowspan="{{ $proposal['rowspan'] }}" style="vertical-align: top; border: 1px solid #000000;">{{ $no++ }}</th>
                    <th rowspan="{{ $proposal['rowspan'] }}" style="vertical-align: top; border: 1px solid #000000;">{{ $proposal['kode'] }}</th>
                    <th rowspan="{{ $proposal['rowspan'] }}" style="vertical-align: top; border: 1px solid #000000;">{{ $proposal['jenis'] }}</th>
                    @foreach ($proposal['detil'] as $res => $val)
                        @if($res == 0)
                            <th style="border: 1px solid #000000;">{{ $val['fak'] }}</th>
                            <th style="border: 1px solid #000000;">{{ $val['nama'] }}</th>
                            <th style="border: 1px solid #000000;">{{ $val['nim'] }}</th>
                            <th style="border: 1px solid #000000;">{{ $val['keanggotaan'] }}</th>
                        @endif
                    @endforeach
                    <th rowspan="{{ $proposal['rowspan'] }}" style="vertical-align: top; border: 1px solid #000000;">{{ $proposal['email_ketua'] }}</th>
                    <th rowspan="{{ $proposal['rowspan'] }}" style="vertical-align: top; border: 1px solid #000000;">{{ $proposal['judul'] }}</th>
                    <th rowspan="{{ $proposal['rowspan'] }}" style="vertical-align: top; border: 1px solid #000000;">{{ $proposal['dospem'] }}</th>
                    <th rowspan="{{ $proposal['rowspan'] }}" style="vertical-align: top; border: 1px solid #000000;">{{ $proposal['email_dospem'] }}</th>
                    <th rowspan="{{ $proposal['rowspan'] }}" style="vertical-align: top; border: 1px solid #000000;"><a href="{{ $proposal['link'] }}" target="_blank">Link</a></th>
                    <th rowspan="{{ $proposal['rowspan'] }}" style="vertical-align: top; border: 1px solid #000000;">{{ $proposal['status'] }}</th>
                    <th rowspan="{{ $proposal['rowspan'] }}" style="vertical-align: top; border: 1px solid #000000;">{{ $proposal['rata'] }}</th>
                </tr>
            {{-- @else --}}
                @foreach ($proposal['detil'] as $res => $val)
                    @if($res != 0)
                        <tr valign="top">
                            <th style="border: 1px solid #000000;">{{ $val['fak'] }}</th>
                            <th style="border: 1px solid #000000;">{{ $val['nama'] }}</th>
                            <th style="border: 1px solid #000000;">{{ $val['nim'] }}</th>
                            <th style="border: 1px solid #000000;">{{ $val['keanggotaan'] }}</th>
                        </tr>
                    @endif
                @endforeach
            {{-- @endif --}}
            @php
                // $tempKode = $proposal['kode'];
            @endphp
        @endforeach
    </tbody>
</table>
