# Is it possible to alternate row colors for collection\_select

**URL:** <https://www.ruby-forum.com/t/is-it-possible-to-alternate-row-colors-for-collection-select/166315>\
**Category:** Rails\
**Created:** [April 23, 2009, 8:45pm UTC](https://www.ruby-forum.com/t/is-it-possible-to-alternate-row-colors-for-collection-select/166315 "2009-04-23T20:45:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gmoniey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/6a8cbe/32.png) [@gmoniey](https://www.ruby-forum.com/u/gmoniey)\
**Post date:** [April 23, 2009, 8:45pm UTC](https://www.ruby-forum.com/t/is-it-possible-to-alternate-row-colors-for-collection-select/166315/1 "2009-04-23T20:45:36Z")

</div>

Hi,

I have something as such:

collection\_select(:obj, :types, @types, :id, :name, {}, {:multiple =\>  
true, :size =\> 4})

and I want the row colors to alternate. This is easy to do when manually  
building the options tags (as you just add a class name for every other  
tag), but I cant figure out how to do it the rails way

Any suggestions?

Thanks.
