I'm not sure whether this post should go in this forum, or in the jquery one. Everytime I try to use jquery in
one of my Wordpress sites, and google for answers, I get a multitude of different opinions on what to do.
I want to use the jquery that comes with Wordpress.

I am converting a client's site into a Wordpress CMS and on one page there is a schedule in table form where
different table cells are color-coded depending on which session the date is in.

I used the plugin tinyMCE Advanced to allow the client to build various tables on the site. With this plugin, I can
change the background color of the text in the table cell (the editor wraps it in a <span> tag), but not the background-color of the table cell itself.

Here is an image of what I want ... and an image of what the editor will allow me to do.
static-table.jpgwordpress-table.jpg

This is the code I put in the head of my site. It doesn't work, but I have no idea what to do to fix it. Can anyone help me?

HTML Code:
<?php wp_enqueue_script('jquery'); ?>

   <script type="javascript">

     $(document).ready(function() {
          $('#schedule_9week span').each(function(){
             $(this).parent().css('background-color', $(this).css('background-color'));
          });
      });

   </script>

	<?php wp_head(); ?>
</head>