0

When I use 'htmlOptions'=>array('class'=>'table-bordered table-condensed'), the custom classes were added to the wrapper div and not to the table element

<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>

Thanks!

Update: As end result I need the following:

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

Answer:

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

2 Answers2

0

For each row?

'rowCssClassExpression'=>'(($data->live==1) ? "anotherclass" : "myclass")',
Jonnny
  • 4,939
  • 11
  • 63
  • 93
0

You need the itemsCssClass:

'htmlOptions'=>array('itemsCssClass'=>'table-bordered table-condensed'),
Michiel
  • 2,143
  • 1
  • 21
  • 21
  • Thanks for your answer. That gave me a good direction. That what works is widget('bootstrap.widgets.TbGridView',array('itemsCssClass'=>'table-bordered table-condensed', – user3051938 Feb 10 '14 at 06:47