Of Tables and Toggle - Do somethin only if parent has child.

Of Tables and Toggle - Do somethin only if parent has child.

Hi everyone! I've successfully set up a table with toggling rows and alternate colour, and everything is working decently.
Now, I've tried to do a further step by trying to style the parent row who do have child differently from those who don't, so that the user immediatly knows where clicking will bring result and where not.
How can i do it? I've tried with the :parent selector but nothin, still keep looking all the same.
Here's my starting code:
  1. <script type="text/javascript" src="../catalogo/js/jquery.js"></script>
    <script type="text/javascript">
        $(function() {
        $('.parent')
            .css("cursor","pointer")
            .attr("title","Click to see")
            .click(function(){
                $(this).siblings('.child-'+this.id).toggle();
            });
        $('tr[@class^=child-]').hide();
            });
    </script>
    <script type="text/javascript" src="../catalogo/js/jquery.js"></script>
    <script type="text/javascript">
        $(document).ready(function()
    { $(".parent:even").css("background-color", "#FFFFFF");
      $(".parent:odd").css("background-color", "#F2F1ED");
      $(".child:even").css("background-color", "#FFFFFF");
      $(".child:odd").css("background-color", "#FAFAFA");
      $("a").click(function(event){
                      $('.parent').unbind('click');
                      });
    });
    </script>






















One more detail: i've got a dynamically generated table (from MySQL db) with more than 1000 rows.
Thank for help.