Php: spread data in several columns

I need your help with this small issue as my developing level is not the best In the room ( faraway :slight_smile: )

I would like to spread the results of my SQL request in 3 columns.

After the first 37 entries, I would like the entries 38 to 74 are filling the column #2, and column #3 over 74…

I hope it is clear.

please find below the code of my page:

<title>TITLE</title>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800;900&display=swap" rel="stylesheet">
<style>
body {background-color: #000000;}
table {
    background-color: #000000;
    border-collapse: collapse;
    width: 100%;

}
table, .table {
    color: #fff;
      font-family: "Montserrat", sans-serif;
  font-size: 18px;
  font-weight:800;
font-weight:Extra-bold;
}
tr:nth-child(even) {
background-color: #60451e;
}
</style>
<div class="container">	
	<div class="row">
		<?php
		include_once("inc/db_connect.php");
		$sqlQuery = "SELECT  name, GROUP_CONCAT(id ORDER BY id SEPARATOR ' | ') as grouped_id  FROM developers GROUP BY name";
		$resultSet = mysqli_query($conn, $sqlQuery) or die("database error:". mysqli_error($conn));
		?>
		<table id="editableTable" class="table table-bordered">

			<tbody>
				<?php while( $developer = mysqli_fetch_assoc($resultSet) ) { ?>
				   <tr id="<?php echo $developer ['id']; ?>">
				   <td><?php echo $developer ['name']; ?><br>&emsp;  <span style="color: #ffc000">BOXES > <?php echo $developer ['grouped_id']; ?></span></td>
				   </tr>
				<?php } ?>
			</tbody>
		</table>	
  </div>
</div>

and I would like to keep a formatting similar to this for each entry:

echo $developer ['name']; ?><br>&emsp;  <span style="color: #ffc000">BOXES > <?php echo $developer ['grouped_id']; ?></span>

Thank you in advance

You may wish to use a HTML table, but you’re still stuck with populating it out of order (in that tables fill left to right, not top to bottom) - so would need to do something like use the PHP to populate a JavaScript array and fill the table from that.

Another approach could be to use flex (CSS display) items, set it to vertical, and its element width to 33% thus locking in 3 columns, the its height to 2.7% (being 37 / 100). You will have a problem though if the total number of records is greater than 111 as you’ll have no place for them in this approach.

These are my admittedly low-tech solutions, there could be a smarter & cleaner way of doing what you need here - so let’s hope someone else comes up with them :wink: