title: PHP: How to display multiple MySQL table records per HTML table row using MySQLi
body: <p>I would like to display a group of elements in a row in php from mysql database. I already did it, but my data appears in one long column. I would like every new element to appear one next to the other. </p>
  
  <p>Here is a screenshot of what I get. I would like to the first one to be next to the second one: </p>
  
  <p><a href="https://www.dropbox.com/s/2y3g0n7hqrjp8oz/Capture.PNG?dl=0" rel="nofollow noreferrer">https://www.dropbox.com/s/2y3g0n7hqrjp8oz/Capture.PNG?dl=0</a></p>
  
  <p>Here is my code:</p>
  
  <pre><code>    &lt;?php
      require_once 'core/init.php';
      include 'includes/navigation.php';
  
      $sql = "SELECT * FROM interviews WHERE featured = 1";
      $featured = $db-&gt;query($sql);
  
  
      &lt;html&gt;
  </code></pre>
  
  <p><code>enter code here</code>
  <code>enter code here</code></p>
  
  <pre><code>    &lt;link href="http://localhost/menu/css/academy.css" rel="stylesheet" `enter code here`type="text/css" /&gt;
  </code></pre>
  
  <p></p>
  
  <p></p>
  
  <p></p>
  
  <pre><code>    &lt;?php while($product = mysqli_fetch_assoc($featured)) : ?&gt;
      &lt;table&gt;
      &lt;tr&gt;
          &lt;th&gt;
          &lt;div id="element1"&gt;&lt;/div&gt;
          &lt;div id="content1"&gt;
  
              &lt;img src="&lt;?= $product['image']; ?&gt;" alt="&lt;?= $product['title']; ?&gt;"&gt;
              &lt;h4&gt;&lt;?= $product['title']; ?&gt;&lt;/h4&gt;
              &lt;hr&gt;
              &lt;p class="description"&gt;&lt;?= $product['description']; ?&gt;&lt;/p&gt;
  
      &lt;!--------BUTTON 3--------&gt;
      &lt;div id="hovers"&gt;
          &lt;a href="#" class="button"&gt;
              &lt;span class="contentbut"&gt; Read More&lt;/span&gt;
          &lt;/a&gt;
      &lt;/div&gt;
      &lt;/th&gt;
  &lt;/tr&gt;
      &lt;/table&gt;    
      &lt;?php endwhile; ?&gt;      
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>Please, help.</p>
  
  <p>Thank you!</p>