'not getting columns side by side
I have a container that should display products in bootstrap grid, but instead of side by side I just get one column.
<div class="container">
<div class="row text-center py-5">
<div class='col-md-3 col-sm-3 my-3 my-md-0'>
<form action='index.php' method='post' id='myform'>
<?php
$result = $database->getData();
while ($row = mysqli_fetch_assoc($result)) {
component($row['product_name'], $row['product_price'], $row['product_image'], $row['id']);
}
?>
</form>
</div>
</div>
</div>
Solution 1:[1]
<div class="container">
<div class="row text-center py-5">
<form action='index.php' method='post' id='myform'>
<?php
$result = $database->getData();
while ($row = mysqli_fetch_assoc($result)) {
?>
<div class='col-md-3 col-sm-3 my-3 my-md-0'>
<?php
component($row['product_name'], $row['product_price'],
$row['product_image'], $row['id']);
}
?>
</div>
</form>
</div>
</div>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Jitender |
