There’s an attribute ‘cssClassExpression’ in CGridColumn with description “a PHP expression that is evaluated for every data cell and whose result is used as the CSS class name for the data cell”. This class will render the cells of the column it’s representing. This will do the trick for you.
CGridColumn class reference
This class is what you are adding when initiating an CGridView, see examples in admin.php files in the view folder, or see this example (the columns item is where you can add different types of column classes, default is CGridView if the value is a string):