title: Zebra Stripe PHP MYSQL Table
body: <p>I would like to Zebra Stripe the results table.  I can't find a solid solution.  What would I need to do to this table to add a odd/even class to the results rows?</p>
  
  <pre><code> // HTML ... Aliases from Mysql
  echo "&lt;table  class='sortable' id='tablesorter' cellspacing='1' cellpadding='0' border='0' width='920px' &gt;
  &lt;thead&gt;
  &lt;tr&gt;
  &lt;th class='header'&gt;Short Name of Fund&lt;/th&gt;
  &lt;th class='header'&gt;I/C&lt;/th&gt;
  &lt;th class='header'&gt;Fund Manager Company&lt;/th&gt;
  &lt;th class='header'&gt;Class&lt;/th&gt;
  &lt;th class='header'&gt;Special Class&lt;/th&gt;
  &lt;th class='header' id='custom'&gt;TTR year-to-date&lt;br /&gt; %&lt;/th&gt;
  &lt;th class='header'&gt;Mgmt Fee Effectively Charged&lt;/th&gt;
  &lt;th class='header id='custom'&gt;Total Expenses &lt;br /&gt; %&lt;/th&gt;
  &lt;th class='header'&gt;Fund Size&lt;/th&gt;
  &lt;/thead&gt;&lt;tbody&gt;
  
  &lt;/tr&gt;";
  
  //&lt;tr&gt; specifies table row. for each &lt;td&gt; (table data) will specify a new column.  The $row specifies the mysql column name (in this case using an alias)
  while($row = mysql_fetch_array($result))
    {
    echo "&lt;tr&gt;";
    echo "&lt;td&gt;&lt;a href=\"page.php?id={$row['ID']}\"&gt;{$row['Short Name of Fund']}&lt;/a&gt;&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['I/C'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['Fund Manager Company'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['Class'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['Special Class'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['TTR year-to-date %'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['Mgmt Fee Effectively Charged'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['Total Expenses %'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['Fund Size'] . "&lt;/td&gt;";
  
  
    echo "&lt;/tr&gt;";
    }
  echo "&lt;/tbody&gt;&lt;/table&gt;";
  </code></pre>