Divide laravel table into 4 columns from a single foreach - Hack The Tech - Latest News related to Computer and Technology

Hack The Tech - Latest News related to Computer and Technology

Get Daily Latest News related to Computer and Technology and hack the world.

Sunday, August 20, 2023

Divide laravel table into 4 columns from a single foreach

I have a foreach loop that has data. I am using a foreach loop to echo the data out into a table.

@foreach($data as $key)
 <tr>
   <td></td>
</tr>
@endforeach()

This gives me a table with one column and 1 row of data. This table only has one data field and instead of one long list of data, i want it spread over 4 columns.

I would like to have 4 columns so the table looks nice and neat.

Please see attached example image.

How it is now CURRENT

What i am trying to achieve, after the 4 columns if there is more data then it starts the next row with 4 columns. HOW I WANT IT



source https://stackoverflow.com/questions/76928967/divide-laravel-table-into-4-columns-from-a-single-foreach

No comments:

Post a Comment