How to display each Row of Data from MYSQL to html page each in their own separate div element

This code displays all of them all at once but I want to display them side by side

<div class="main">

<div id="display">  
<?php
if ($result->num_rows > 0) {
        // Loop through each row and display the data
        $divcount = 1;
        while ($row = $result->fetch_assoc()) {
            
            echo '<div id="display' . $divcount++ .'" >';
            echo '<img src="' . $row["photo"] . '" alt="Car Image" style="width:190px;height:180px; max-width:250px;"><br>';
            echo "Name: " . $row["car_brand"] . " " . $row["car_type"] . "<br>";
            echo "Manufactured Date: " . $row["manufactured_date"] . "<br>";
            echo "Price: " . $row["price"] . "<br>";
            echo "Fuel Type: " . $row["fuel_type"] . "<br>";
            echo "Condition: " . $row["condition"] . "<br>";
            echo "Phone No: " . $row["phone_number"] . "<br>";
            echo '</div>';
            
        }
    } else {
        echo "No records found in the database.";
    }
    ?>
    
</div>

Looking for a code that works and a good explanation and point to me for a good resource that can solve other problems like this