 <p>You need to add <code>&lt;tr&gt;</code> in while loop like,</p> <pre><code>&lt;?php $result = mysql_query("SELECT * FROM A"); while($row=mysql_fetch_array($result)){ ?&gt; &lt;tr&gt; &lt;!-- add this tr --&gt; &lt;td&gt;&lt;?php echo $row["source_id"]; ?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo $row["escl_status"]; ?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo $row["escl_notice"]; ?&gt;&lt;/td&gt; &lt;/tr&gt; &lt;?php } ?&gt; </code></pre> <p>Also change <code>.odd</code> to <code>:odd</code> in your jquery selector,</p> <pre><code>$("#report tr:odd").click(function(){ // :odd not .odd $(this).next("tr").toggle(); $(this).find(".arrow").toggleClass("up"); }); </code></pre>