title: Displaying two column html table while php loop
body: <p>Am creating a newsletter template that can display news in tabular form, but i want the news to be displayed in two column per row.
  Please check this url to see what i am talking about <a href="http://www.ipaidabribenaija.com/newsletter.php" rel="nofollow">http://www.ipaidabribenaija.com/newsletter.php</a>
  Thanks.</p>
  
  <pre><code>    &lt;?php
      $conn = mysql_connect("localhost", "rppt", "peep") or die(mysql_error());
  
      mysql_select_db('news', $conn) or die(mysql_error());
  
      $query = mysql_query ("Select i.nid, LEFT(i.fulltext, 350), UPPER(i.title), 
  LOWER(c.name) from nl i JOIN jos_k2_categories c ON c.id=i.catid ORDER BY i.id LIMIT 0, 16") or die ('Error');
  
      $href = "http://www.ipaidabribenaija.com/index.php";
  
  ?&gt;
  
  
  
  &lt;table width="500px" align="center"&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td width="400px" height="344px" valign="top"&gt;
  &lt;table cellspacing="5"&gt;
          &lt;tbody&gt;
  
  
           &lt;?php
              while(list($id, $fulltext, $title, $name)=mysql_fetch_array($query))
              {
                  $i = 0;
           ?&gt;
           &lt;?php
              $replacename = eregi_replace(" ",  "-", $name);
           ?&gt;
          &lt;tr&gt;
              &lt;td height="34"&gt;&amp;nbsp;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;?php
              if($i%2 == 0)
              {
          ?&gt;
          &lt;tr&gt;
              &lt;tr&gt;
                  &lt;td height="34"&gt;
  &lt;font color="#FF0000" size="+2"&gt;&lt;strong&gt;&lt;?php echo $title; ?&gt;&lt;/strong&gt;&lt;/font&gt;&amp;nbsp;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td height="34"&gt;&lt;p&gt;&lt;?php echo $fulltext; ?&gt;...&lt;/p&gt;
  
                      &lt;p&gt;&lt;a href="&lt;?php echo $href ."/". $replacename ."/item/". $id; ?&gt;"&gt;read more...&lt;/a&gt;&lt;/p&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;?php
                  }
                  else{
              ?&gt;
                  &lt;tr&gt;
                      &lt;td height="34"&gt;&lt;font color="#FF0000" size="+2"&gt;&lt;strong&gt;&lt;?php echo $title; ?&gt;&lt;/strong&gt;&lt;/font&gt;&amp;nbsp;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td height="34"&gt;&lt;p&gt;&lt;?php echo $fulltext; ?&gt;...&lt;/p&gt;
                          &lt;p&gt;&lt;a href="&lt;?php echo $href ."/". $replacename ."/item/". $id; ?&gt;"&gt;read more...&lt;/a&gt;&lt;/p&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;?php
                      }
                          }
                  ?&gt;
          &lt;/tr&gt;
          &lt;/tbody&gt;
       &lt;/table&gt;
      &lt;/td&gt;
      &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>