How to extend width of GridView column correctly?

Hy guys, a simple intention, but I don’t succeed with following code. On the one hand, I won’t get any error, on the other hand, code is ineffective.

How to code in order to get my intention, to define width of GridView column manually?





    'dataProvider' => $dataProvider,

    'filterModel' => $searchModel,

    'filterSelector' => '.choiceRadio',

    'id' => 'cb',

    'columns' => $gridColumn,

    'condensed' => true,

    'responsive' => true,

    'panel' => [

        "heading" => "<h3 class='panel-title'><i class='glyphicon glyphicon-globe'></i> " . $this->title . "</h3>",

        'type' => 'danger',

        'before' => Html::a('<i class="glyphicon glyphicon-plus"></i> Erzeuge Bewerber', ['/bewerber/bewerber/create'], ['class' => 'btn btn-success']),

        'after' => Html::a('<i class="glyphicon glyphicon-repeat"></i> Reset Grid', ['/bewerber/bewerber/index'], ['class' => 'btn btn-info']),

        'footer' => false,


    'toggleDataOptions' => ['minCount' => 10],

    'options' => [ //this is ineffective

        'style' => 'overflow: auto; word-wrap: break-word;'





        'attribute' => $dummy,

        'contentOptions' => [ //this is ineffective,too

            'style' => ['width' => '700px;']],

        'label' => Yii::t('app', 'Bewerber/Kandidat'),

        'format' => 'html', 

        'value' => function($model) {







The value of style is css

'contentOptions'=>['style'=>'width: 100px;']

Notice the colon after width, semi-colon after the pixel amount all in one set of single quotes.

This solution is no difference to mine and unsatisfactory. I am not able to define very small or very large width. For instance, if i will set a width of 20px,there is no effect. The same with 3000px. I only notice diffreneces using "normal" statements such as 500px/600px etc…

As it seems, available space will be partitioned by another columns as primary option and my width statements only as secondary option

You mean no difference as in you changed [‘style’ => ‘width: 700px;’] to [‘style’=>‘width: 700px;’] and it had no effect or did you not see how these are different?

I mean following:

It doesn’t matter, if I define width like this:

'contentOptions' => [ //this is ineffective,too

   'style' => ['width' => '700px;']],

or like this

'contentOptions'=>['style'=>'width: 700px;']

It’s both same! But both rules don’t work for special values as shown upon…

Try ‘contentOptions’ => [‘style’ => ‘display: inline-block; width: 700px;’],