title: php table grid layout
body: <p>I wanted to fetch data inside PHP table in grid layout. So I made this code. I don't know what went wrong or if I am missing something. I wanted the table to have three columns but it shows the table in a single column. Any help will be appreciated.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;PAGINATION FILTER&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;?php include 'conn.php';?&gt;
  &lt;?php
  
      $stmt=$con-&gt;prepare('SELECT author, book_name, language FROM bk_tst_fltr ORDER BY id LIMIT 8');
      $stmt-&gt;execute();
      $stmt-&gt;bind_result($author, $book_name, $language);
      $stmt-&gt;store_result();
      $i=0;
      ?&gt;
      &lt;table border="1" cellpadding="10"&gt;
      &lt;?php
      while($stmt-&gt;fetch()){
          if($i % 3 == 0){
          ?&gt;&lt;tr&gt;&lt;td&gt;&lt;?php echo $author,"\n&lt;/br&gt;",$book_name,"\n&lt;/br&gt;", $language ;?&gt;&lt;/td&gt;
      &lt;?php
      }}
      ?&gt;&lt;/tr&gt;&lt;/table&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>