是否可以将自定义类添加到bootstrap.widgets.TbGridView的table元素中?

时间:2014-02-08 21:07:30

标签: yii yii-booster

当我使用'htmlOptions'=>数组('class'=>'table-bordered table-condensed')时, 自定义类已添加到包装器div而不是表元素

<div id="contact-grid" class="table-bordered table-condensed">
<div class="summary">Displaying 1-6 of 6 results.</div>
<table class="items table">
<thead>
<tr>

谢谢!

更新 作为最终结果,我需要以下内容:

<div id="contact-grid">
<div class="summary">Displaying 1-6 of 6 results.</div>
<table class="items table table-bordered table-condensed">
<thead>
<tr>

答案:

<?php $this->widget('bootstrap.widgets.TbGridView',array(
'id'=>'contact-grid',
...
'itemsCssClass'=>'table-borde‌​red table-condensed',

2 个答案:

答案 0 :(得分:0)

对于每一行?

'rowCssClassExpression'=>'(($data->live==1) ? "anotherclass" : "myclass")',

答案 1 :(得分:0)

您需要itemsCssClass

'htmlOptions'=>array('itemsCssClass'=>'table-bordered table-condensed'),