Table row colors change
<p>Hello friends i want to change background color of every <code>&lt;tr&gt;</code> i am trying to do the same not getting the result i know there is some problem in my code. Please help me out </p>

<p>Following is my code check online <strong><a href="http://jsfiddle.net/QnVdE/" rel="nofollow">DEMO</a></strong></p>

<p><strong>SCRIPT</strong></p>

<pre><code>var b = new Array('col_one','col_two','col_three');

$('#tbl tr').each(function(){

var a = 0;

$('#tbl tr').addClass(b[a])

a++;


})
</code></pre>

<p><strong>CSS</strong></p>

<pre><code>.col_one
{
    background:#000099;
}
.col_two
{
    background:#009966;
}
.col_three
{
    background:#663333;
}
</code></pre>

<p><strong>HTML</strong></p>

<pre><code>&lt;table width="100%" border="1" cellspacing="0" cellpadding="0" id="tbl"&gt;
  &lt;tr&gt;
    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
</code></pre>
