title: Adding a class to Yii2 CRUD GridView
body: <p>I've been trying to add a class to the images' column in the CRUD GridView in Yii2. So far, I've managed to display the image, but at its full width and height. I need to add a 'col-md-3' bs class to the image.</p>
  
  <p>This is what I pulled off:</p>
  
  <pre><code>&lt;?= GridView::widget([
      'dataProvider' =&gt; $dataProvider,
      'filterModel' =&gt; $searchModel,
      'columns' =&gt; [
          ['class' =&gt; 'yii\grid\SerialColumn'],
  
          'emp_firstname',
          'emp_lastname',
          'emp_photo' =&gt; [
              'format' =&gt; 'image',
              'attribute' =&gt; 'emp_photo',
              'value' =&gt; 'emp_photo',
              'contentOptions' =&gt; ['class' =&gt; 'col-md-3'],
          ],
  
          ['class' =&gt; 'yii\grid\ActionColumn'],
      ],
  ]); ?&gt;
  </code></pre>