styling radioButtonList

Hello,

how do i style the list item rendered from Chtml::radioButtonList that will style like that of this forum’s topic list

(having css like tr:even and tr:odd)

thanks in advanced.

Not sure what you want, but it looks more like a CSS issue?

yes this is a CSS issue but how could i link a css file to the

the radioButtonList just like that of the cgridview or cdetailview

widgets.

i really want to display the radioButtonList rendered items such that the display will be

like that of CGridview

thanks in Advance.

One solution might be to use the template htmlOption




echo CHtml::radioButtonList(..., ..., ..., array('template'=>'<span class="rb">{input} {label}</span>')

);



and use js to set the css class




$(".rb:even").each(function(){

  $(this).addClass('even');

});

$(".rb:odd").each(function(){

  $(this).addClass('odd');

});



/Tommy (will have to learn some more jQuery)

i am most grateful

thanks :) :) :)

i think i will write a tutorial on it for others to benefit

thanks once again

nice