<?php	
    header("Content-type: application/vnd.ms-excel");
    header("Content-Disposition: attachment; filename=Data {$dataset->tabelData->name}.xls");
    header("Pragma: no-cache"); 
  ?>

  <table border="1" width="100%">
    <tr style="text-align: center; font-weight:bold; vertical-align:middle;">
        <td colspan="{{ count($tabel)+1 }}">{{ $dataset->tabelData->name }} - {{$dataset->tahun - 1}}</td>
    </tr>
    <tr style="vertical-align:middle;">
        <td style="background:#ddd;" width="3%">No</td>
        @foreach ($tabel as $dataKolom)
            <td style="background:#ddd;">{{$dataKolom->name}}</td>
        @endforeach
    </tr>
    @foreach ($txdataset as $rowId => $rows)
    <tr>
        <td>{{$rowId}}</td>
        @foreach ($rows as $cell)
            <td>{{$cell->value;}}</td>
        @endforeach
    </tr>
    @endforeach
  </table>