其他分享
首页 > 其他分享> > yii2 GridView::widget 每列宽度

yii2 GridView::widget 每列宽度

作者:互联网

[
'attribute'=>'商品SKU名称',
'contentOptions' => ['style' => 'max-width:400px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;'],
'content'=>function($m){
if($m->goodsname){
$skunames='';
foreach ($m->goodsname as $k=>$v){
$skunames.=$v->goods_SKU_name."<br>";
}
return $skunames;
}else{
return '';
}
}
],

 

主要加这一句 'contentOptions' => ['style' => 'max-width:400px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;'],

标签:SKU,style,GridView,nowrap,每列,skunames,overflow,yii2,goodsname
来源: https://www.cnblogs.com/qqyj/p/16422690.html