I am using laravel-dompdf to create PDF file. I want to use foreach loop to put data horizontally into three columns. It is not easy.
$items = ['aaa', 'bbb', 'ccc', 'ddd', 'eee', 'ffff', 'gggg', 'hhhh', 'iiii'];
<table style="width:100%">
@foreach($items as $key => $item)
<tr>
@if($key % 2 == 0)<td>{{ $item }}</td>@endif
@if($key % 2 != 0)<td>{{ $item }}</td>@endif
</tr>
@endforeach
</table>