【发布时间】:2016-02-15 14:59:39
【问题描述】:
我需要指定特定列的宽度(例如“文件名”)。我已经尝试过these 的建议,但它对我不起作用。
一种可能的解决方案是调整列的大小,但我也不知道该怎么做。
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'tableOptions'=>['class'=>'table-striped table-bordered table-condensed'],
'options'=>['style' => 'white-space:nowrap;'],
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'lastname',
'firstname',
'middlename',
'rs_account',
'sum',
'file_name',
'state',
'history_id',
[
'label' => 'Code',
'attribute' => 'codes.code',
],
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
【问题讨论】:
-
@Kevin 想知道您是否解决了问题
-
@Kevin,不,很遗憾。现在我无法访问源代码,也无法测试其他可能的解决方案。