title: Create a grid view for a PHP query
body: <p>So I tried to figure out how to take my PHP query and display them in a grid view.
  I want to make it a grid of 3 columns so it looks like this: First column: 1, 2, 3 Second column: 4, 5, 6 and so on...</p>
  
  <p>Here is my code to view MySQL query via PHP:</p>
  
  <pre><code>&lt;div class='main_col'&gt; &lt;!--Start of the Main--&gt;
  &lt;div class='main_content'&gt;
  &lt;?php
  include("includes/connect.php");
  
  $select_games = "SELECT * FROM games";
  
  $run_games = mysql_query($select_games);
  
  while($row = mysql_fetch_array($run_games)){
  
  $game_id = $row['game_id'];
  $game_name = $row['game_name'];
  $game_category = $row['game_name'];
  $game_keywords = $row['game_name'];
  $game_image = $row['game_image'];
  
  ?&gt;
  
  &lt;p&gt;&lt;a href="game_page.php?id=&lt;?php echo $game_id; ?&gt;"&gt;&lt;?php echo $game_name; ?&gt;&lt;/a&gt;&lt;/p&gt;
  
  &lt;a href="game_page.php?id=&lt;?php echo $game_id; ?&gt;"&gt;&lt;img src="images/games_images/&lt;?php echo $game_image; ?&gt;" width="120" /&gt;&lt;/a&gt;
  
  &lt;?php } ?&gt;
  &lt;/div&gt;
  &lt;/div&gt; &lt;!--End of the Main--&gt;
  </code></pre>
  
  <p>I tried this:</p>
  
  <pre><code>&lt;div class='main_col'&gt; &lt;!--Start of the Main--&gt;
  &lt;div class='main_content'&gt;
  &lt;?php
  include("includes/connect.php");
  
  $select_games = "SELECT * FROM games";
  
  $run_games = mysql_query($select_games);
  
  while($row = mysql_fetch_array($run_games)){
  
  $game_id = $row['game_id'];
  $game_name = $row['game_name'];
  $game_category = $row['game_name'];
  $game_keywords = $row['game_name'];
  $game_image = $row['game_image'];
  
  ?&gt;
  
  &lt;table&gt;
  
  &lt;tr&gt;
  &lt;td&gt;&lt;p&gt;&lt;a href="game_page.php?id=&lt;?php echo $game_id; ?&gt;"&gt;&lt;?php echo $game_name; ?&gt;&lt;/a&gt;&lt;/p&gt;
  
  &lt;a href="game_page.php?id=&lt;?php echo $game_id; ?&gt;"&gt;&lt;img src="images/games_images/&lt;?php      echo $game_image; ?&gt;" width="120" /&gt;&lt;/a&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;?php } ?&gt;
  &lt;/div&gt;
  &lt;/div&gt; &lt;!--End of the Main--&gt;
  </code></pre>
  
  <p>Suggestions anybody? :(</p>