Themeing table rows background

Posts: 128
Joined: 08/12/2007
Bug FinderGetting busy with the Ubercode.

Hi,

I'm working on this module where I have a table where as part of the theme every odd row is light blue.

I'd like to add another background color to the rows based on a value in the db for each row.

I'm really not sure how to do this? If I could somehow add a class to each tr tag that would do the trick.

anyone know how to do this. I'm currently rendering the table like so:
$output = theme('table', $header, $rows); $output is returned in the theme function/hook.

thanks

Idan

Posts: 5617
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Adding a class to a row should be something like...

<?php
  $rows
[] = array(
   
'data' => array(
     
'Cell one',
     
'Cell two',
    ),
   
'class' => 'my-row-color',
  );
?>

Posts: 128
Joined: 08/12/2007
Bug FinderGetting busy with the Ubercode.

thanks, exactly what I was looking for!