php – I need to put each card horizonally using bootstrap?

Question

The data in each card is getting pulled from an API and I can’t figure out how to get it in a 3 column layout using bootstrap or if you know another way that would be great too.

Here is the code:

<?php
  $url="https://jsonplaceholder.typicode.com/todos";
  $data = file_get_contents($url); 
  $properties = json_decode($data); 

  foreach ($properties as $property) {
    ?>
      <div class="container">
        <div class="row">
          <div class="col-3 card text-center py-4 px-3 mb-4 mr-4">
            <img src="<?php echo $property->logo; ?>" /><br />
            <h5><?php echo $property->title; ?></h5><br />
            <a href="<?php echo $property->button; ?>" class="btn btn-primary">View Event</a>
          </div>
        </div>
      </div>
    <?php
  }
?>

Here is a screenshot:

enter image description here

0
baiy33 6 months 2022-02-25T19:18:06-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse