0

I have read https://laravel-excel.maatwebsite.nl/3.0/exports/from-view.html but none from this explain how to styling table.

    public function print(Request $request)
     {

    $this->validate($request, [
        'start_date'  => 'required|date',
        'end_date'  => 'required|date',
    ]);

    return (new JobsExport($request->input('start_date'),$request->input('end_date')))->download('business_travel.xlsx');

}

heres my blade :

<table align="center" width="100%" style="border:1px solid #000">
    <tr><th colspan="10">TITLE</th></tr>
    <tr><th colspan="10">SUBTITLE 1</th></tr>
    <tr><th colspan="10">SUBTITLE OF SUBTITLE 1</th></tr>
    <tr>
        <th rowspan="2">No</th>
        ...
        <th colspan="6">Biaya</th>
    </tr>
    <tr>
        <th>UANG HARIAN</th>
        ...
        <th>JUMLAH</th>
    </tr>
    @foreach ($jobs as $index=> $joddetail)
    <tr>
        <th>{{ $index+1 }}</th>
        ...
        <th>{{ $joddetail->other_cost }}</th>
    </tr>
    @endforeach
</table>

result of laravel-excel

I Expected a table like thisenter image description here

Othsout
  • 113
  • 3
  • 15

1 Answers1

0

It is easier to use phpspreadsheet(https://phpspreadsheet.readthedocs.io/en/develop/) directly rather than laravel-excel.

thank you

Othsout
  • 113
  • 3
  • 15