title: Group / Merge Columns Yii2 Gridview
body: <p>How can you merge one or more columns in a gridview?</p>
  
  <p>I am currently using Kartikv Gridview but don't want to create an additional footer / header.</p>
  
  <p>With a normal table this would be achieved with colspan</p>
  
  <p>I want to merge the below "OD" in column 2 with the 4 columns on the right with just "OD" centered</p>
  
  <p><a href="https://i.stack.imgur.com/K0wy8.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/K0wy8.jpg" alt="grdiview"></a></p>
  
  <p>Current GridView:</p>
  
  <pre><code>  &lt;?= GridView::widget([
      'dataProvider'=&gt; $fixtures,
      'columns' =&gt; [
          [
              'header' =&gt; 'Match Date',
              'value' =&gt; function($data){
                  return date("d M Y", strtotime($data['fixtureDate']));
              }
          ],
          [
              'header' =&gt; 'Home / Away',
              'value' =&gt; function($data){
                  return $data['homeAway']
              }
          ],
          [
              'contentOptions' =&gt; function($data){
                  return $style['class'];
              },
              'value' =&gt; function($data){
                  if($data['homeAway'] == 1 || $data['homeAway'] == 0){
                      return $data['homeScore'];  
                  }
              },
          ],
          [
              'value' =&gt; function(){
                  return 'vs';    
              }
          ],
          [
              'value' =&gt; function($data){
                  return $data['awayScore'];
              }
          ],
          [
              'header' =&gt; 'Against',
              'value' =&gt; function($data){
                  return $data['awayTeamName'];
              }
          ]
      ],
      'summary' =&gt; false,
      'responsive'=&gt;true,
      'hover'=&gt;true
  ]); ?&gt;
  </code></pre>