htmlOptions is not working under CDetailView

ref to:


attempt to change display cell background color, no luck, I end up hack ‘value’; but why not htmlOptions?

<?php $this->widget('zii.widgets.CDetailView', array(

	'data' => $model,

	'attributes' => array(





			//'type' => 'raw',

			'value' => $data->field2,





Your formatting is wrong. Try removing the brackets.

Try this:


If that fails, maybe:

'htmlOptions'=>array('style'=>'background-color:#FFFFCC !important;'),

thanks, still no luck with both,

There’s a good post here that may help:

thanks a lot, i will take a look.