'columns' => [
[
'class' => 'yii\grid\SerialColumn',
'contentOptions' => function ($model, $key, $index, $column) {
return ['class' => 'myclass'];
},
],
GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
[
'class' => 'yii\grid\SerialColumn', // <- колонка со счетчиком
'headerOptions' => ['class' => 'some-class'] // кастомный класс для заголовка
],
'id',
'text:raw',
'created',
'updated',
['class' => 'yii\grid\ActionColumn'],
],
]);