jeudi 19 mai 2022

make looping table laravel, where in specific data make a new table

Please help me... i want make table with laravel like this the table i want

but this is what i came up with thead does not appear

this is my code (index.blade.php)


    <?php $index = 0 ?>
    <?php $tempRek = array()?>
    @foreach($datatabel as $datatabel)
    <table id="table" class="table table-striped table-bordered table-hover" style="width: 100%; border-collapse:collapse" border="1">
    @if($index == 0)
      <thead>
        <tr class="judul" id="thead">
          <th width="10%">TANGGAL</th>
          <th width="30%">URAIAN</th>
          <th>REFERENSI</th>
          <th width="10%">DEBET</th>
          <th width="10%">KREDIT</th>
          <th width="10%">SALDO</th>
        </tr>
      </thead>
    @endif
    <?php $index++ ?>
      <tbody>
          <tr>
            <td width="10%"><center></center></td>
            <td width="30%"></td>
            <td></td>
            <td width="10%"></td>
            <td width="10%"></td>
            <td  width="10%" style="text-align: right;"></td>
          </tr>
            <?php $display = FALSE;
            if (!in_array($datatabel['kode'], $tempRek)) {
              $tempRek[] = $datatabel['kode'];
              $display = TRUE;
            }
            ?>
            <b>
            
            
          @if($tempRekening != $datatabel['kode'])</b>
      </tbody>
    </table>
    @endif
    @endforeach

I've been stuck for 2 days...



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire