当我使用'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-bordered table-condensed',
答案 0 :(得分:0)
对于每一行?
'rowCssClassExpression'=>'(($data->live==1) ? "anotherclass" : "myclass")',
答案 1 :(得分:0)
您需要itemsCssClass
:
'htmlOptions'=>array('itemsCssClass'=>'table-bordered table-condensed'),