Jquery IF maybe?
<p>I use the following code to find a particular table, hide it then show it on click:</p>

<pre><code>$(function() {
  $('.Nav table .navitem').hide();
  $('.Nav table.navheader').click(function() {
    $(this).parent().parent().next().find(".navitem").slideToggle('100');
  });
});
</code></pre>

<p>Here is the HTML Output:</p>

<pre><code>&lt;div class="Nav"&gt;

&lt;table cellpadding="0" cellspacing="0" border="0"&gt;
  &lt;tr&gt;
    &lt;td&gt;
      &lt;table class="navheader" cellpadding="0" cellspacing="0" border="0" width="100%"&gt;
       &lt;tr&gt;
        &lt;td style="width:100%;"&gt;&lt;a navheader" href="#"&gt;Header&lt;/a&gt;&lt;/td&gt;
       &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;
      &lt;table border="0" cellpadding="0" cellspacing="0" width="100%" class="navSubMenu"&gt;
       &lt;tr&gt;
        &lt;td&gt;
         &lt;table class="ms-navitem" cellpadding="0" cellspacing="0" border="0" width="100%"&gt;
          &lt;tr&gt;
           &lt;td style="width:100%;"&gt;&lt;a class=" ms-navitem" href="#" style="border-style:none;font-size:1em;"&gt;Item&lt;/a&gt;&lt;/td&gt;
          &lt;/tr&gt;
         &lt;/table&gt;
        &lt;/td&gt;
       &lt;/tr&gt;
      &lt;/table&gt;
</code></pre>

<p>A basic accordion navigation hacked together from a table, however some of the .havheader's do not have .navitem's so I dont want these to be clickable.</p>

<p>How best can i achieve this?</p>
