title: GridView on Yii2: How to freeze header (i.e., have a fixed header row)
body: <p>Is there a way to fix GridView header rows in Yii2?</p>
  
  <p>Pretty new to Yii2 and GridView and have made some searches but there seems to be no straightforward answer. </p>
  
  <p>JSFiddle has the full code I'm working on: <a href="https://jsfiddle.net/farablanco/cf0zs4uc/" rel="nofollow noreferrer">https://jsfiddle.net/farablanco/cf0zs4uc/</a></p>
  
  <pre><code>    &lt;?= GridView::widget([
          'dataProvider' =&gt; $dataProvider,
          'rowOptions' =&gt; function($model){
          },
          'columns' =&gt; [
              // 'slug',
              ['class' =&gt; 'yii\grid\SerialColumn'],
              ['attribute' =&gt; 'title',
               'format'=&gt;'raw',
               'value' =&gt; function($data){
                  return
                  Html::a($data-&gt;title, '/stock-page/?slugparam=' . $data-&gt;slug, ['class'=&gt;'title-link', 'target'=&gt;'_blank']);
               },
               'contentOptions' =&gt; ['class' =&gt; 'title'],
               ],
              ['attribute' =&gt; 'gpa',
               'label' =&gt;'GPA',
               'contentOptions' =&gt; ['class' =&gt; 'gpa'],
               ],
              ['attribute' =&gt; 'dividend_yield',
               'label' =&gt;'Dividend Yield',
               'contentOptions' =&gt; ['class' =&gt; 'dividend_yield'],
               ],
             ...
          ],
      ]); ?&gt;
  </code></pre>