currently Im using laravel maatwebsite fromView to styling my Excel template where I can download it later, the issue is in here, after I set the table to loop the data horizontally which is I view and tested it using browser, but when I downloaded the excel it become vertical, how can I fix this issue?
Example in my browser
below is excel view
<style>
.table {
float: left;
}
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 5px;
text-align: left;
}
</style>
@php
$loop_index = 1;
@endphp
@for ($count=0; $count<=count($all_sales); $count+=8)
<table border="1">
<td>
@foreach ($all_sales->slice($count, 8) as $bil => $days)
@php
$loop_indexing = $loop_index++
@endphp
<table class="table" border="1">
<tr>
<td colspan="5">{{ $bil }}</td>
</tr>
<tr>
<td colspan="5">
@php
$registered_nos = $days->values()->collapse()->map(function($day) {
/* check whether it is only whitespace */
if(!trim($day->registered_no) == '')
{
return $day->registered_no;
}
})->unique();
$registered_no = implode($registered_nos->reverse()->toArray(), ' / ');
@endphp
{{ $registered_no }}
</td>
</tr>
</table>
@endforeach
</td>
</table>
@endfor
question from:
https://stackoverflow.com/questions/65913146/set-excel-data-foreach-horizontally-using-fromview-laravel-maatwebsite 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…