title: how to create a gallery of 3 X 3 (Col X Row) using bootstrap on Api call
body: <p>using Bootstrap for UI and call a api for images to diplay in 3X3 [Col X Row]
  using javascript Async-Await.
   But getting 3 image in colums and not 3 X 3 Grid layout </p>
  
  <p>It can be using  Grid Columns  or using  Flex  In bootstrap 4 </p>
  
  <p>I am use Prototyping using Dog Api for Demo purpose.</p>
  
  <p>On click of Button it will display top 15 images on Grid layout in bootstrap</p>
  
  <p>Not getting correct result  image1 below is output I got.
  Image1 <a href="https://i.stack.imgur.com/WwkQg.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WwkQg.jpg" alt="Image1"></a></p>
  
  <p>But it should display as Image2 with different Image in grid
  Image2
  <a href="https://i.stack.imgur.com/xf2fr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xf2fr.png" alt="Image2"></a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const API_URL = 'https://dog.ceo/api/breeds/image/random/20';
  const randomImgDogs = document.querySelector('.random-dogs');
  const loadingImg = document.querySelector('.loading');
  const getButton = document.querySelector('.getRandomDog');
  
  loadingImg.style.display = 'none';
  
  async function getRandomDogs() {
    randomImgDogs.innerHTML = '';
    loadingImg.style.display = '';
    const response = await fetch(API_URL);
    const json = await response.json();
    console.log(json.message);
    json.message.forEach(dogImage =&gt; {
      randomImgDogs.innerHTML += `
                      &lt;div class="container-fluid"&gt;
                          &lt;div class="d-flex flex-row flex-wrap justify-content-center"&gt;
                              &lt;div class="d-flex flex-column"&gt;
                                  &lt;img src="${dogImage}" class="img-fluid"&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;`;
    });
    loadingImg.style.display = 'none';
  }
  getButton.addEventListener('click', getRandomDogs);</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>img {
    margin: 5px;
  }
  
  .flex-column {
    max-width: 260px;
  }
  
  a svg {
    font-size: 30px;
    text-align: center;
    align-items: center;
    justify-content: center;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.0/css/bootstrap.min.css"&gt;
  &lt;div class="jumbotron text-center"&gt;
    &lt;h1 class="display-4 font-weight-bold text-center"&gt;Random Dogs&lt;/h1&gt;
    &lt;p class="lead"&gt;Click on Get to see some random dogs Images!&lt;/p&gt;
  
  
    &lt;a class="btn btn-primary btn-lg getRandomDog " href="#" role="button"&gt;Get Random Dogs Images
              &lt;svg class="bi bi-chevron-right" width="32" height="32" viewBox="0 0 20 20" fill="currentColor"
                  xmlns="http://www.w3.org/2000/svg"&gt;
                  &lt;path fill-rule="evenodd"
                      d="M6.646 3.646a.5.5 0 01.708 0l6 6a.5.5 0 010 .708l-6 6a.5.5 0 01-.708-.708L12.293 10 6.646 4.354a.5.5 0 010-.708z"
                      clip-rule="evenodd" /&gt;&lt;/svg&gt;
          &lt;/a&gt;
  &lt;/div&gt;
  &lt;!--  --&gt;
  &lt;!-- loading  --&gt;
  &lt;div class="loading text-center"&gt;
    &lt;div class="spinner-border text-dark" style="width: 3rem; height: 3rem;" role="status"&gt;
      &lt;span class="sr-only"&gt;Loading...&lt;/span&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;!-- loading ends --&gt;
  
  
  &lt;!-- main  start --&gt;
  &lt;div class="random-dogs"&gt;
  
  &lt;/div&gt;
  &lt;!-- main ends --&gt;</code></pre>
  </div>
  </div>
  </p>