如何在GridView中合併一列或多列?組合/合併列Yii2 Gridview
我目前使用Kartikv Gridview,但不想創建一個額外的頁腳/標題。
與正常的表,這將與合併單元格來實現
我想只是「OD」與右邊的4列合併下面的「OD」,在第2列居中
當前的GridView:
<?= GridView::widget([
'dataProvider'=> $fixtures,
'columns' => [
[
'header' => 'Match Date',
'value' => function($data){
return date("d M Y", strtotime($data['fixtureDate']));
}
],
[
'header' => 'Home/Away',
'value' => function($data){
return $data['homeAway']
}
],
[
'contentOptions' => function($data){
return $style['class'];
},
'value' => function($data){
if($data['homeAway'] == 1 || $data['homeAway'] == 0){
return $data['homeScore'];
}
},
],
[
'value' => function(){
return 'vs';
}
],
[
'value' => function($data){
return $data['awayScore'];
}
],
[
'header' => 'Against',
'value' => function($data){
return $data['awayTeamName'];
}
]
],
'summary' => false,
'responsive'=>true,
'hover'=>true
]); ?>
請出示你的GridView代碼.. – scaisEdge
任何人都得到一個答案,這一次請 – makie
我已經張貼解答希望是有用 – scaisEdge