I have a table containing a sports schedule, created by the Views module, with data from CCK nodes. Any ideas on how I can bold all rows that contain the value "home" in the location column? Is there a way to add a class to the row, based on the value contained in a particular field?

Essentially, I'm trying to do something like this. . .

|Date |Opponent |Location |Time |
|8/18 |Ants |Away |7PM |
|8/24 |Rats|Home |5pm |
|8/26 |Bats |Away |9PM |
|8/31 |Cats |Home |10PM |

I would guess that the Views Theme Wizard would be a good starting point, but I understand it doesn't support table views. If nothing else, I can do the highlighting in jquery relatively easily, but I wanted to double check here before going that route.

And on the subject of views, thanks for the great module — it's a lifesaver!

Comments

matt v.’s picture

Status: Active » Closed (fixed)

I managed to do what I needed in jquery. In case anyone runs across this in search of a similar answer, adding the following code to the footer of the view did what I needed.

<?php
drupal_add_js (
    '$(document).ready(function(){$(\'td:contains("Home")\').parent().addClass(\'highlight\');}); ',
    'inline');
?>