V
V
Vasily2016-11-18 05:57:24
Yii
Vasily, 2016-11-18 05:57:24

How to remove padding between table and paginator in GridView?

Using the GridView widget, I display a table with data. The field for the table is small, you can’t do without a paginator, but it is displayed much lower than the table.

GridView::widget([
   'dataProvider' => $tasksHistoryDataProvider,
   'columns' => [
      'id',
      [
        'attribute' => 'text',
        'value' => function (\app\models\Tasks $data) {
           $output_text = \yii\helpers\StringHelper::truncate($data->text,50,'...');
           return Html::a(Html::encode($output_text), yii\helpers\Url::to(['view', 'id' => $data->id]));
        },                
        'format' => 'raw',
      ],
      [
          'attribute' => 'created_at',
          'format' => ['date', 'dd.MM.Y'],
          'options' => ['width' => '100']
      ],
   ],
   'layout' => "<p> {items}\n{pager} </p>",
   'showHeader' => false,
]),

499a3d27d742489e859eefefed3dbd55.JPG
So I understand that most likely you need to edit the field 'layout', but so far this has not helped.
How to remove this indent? And how can you control its display?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
iBird Rose, 2016-11-18
@parazitl2

remove margin-bottom not? and do it in css, not in widget options.

M
Maxim Timofeev, 2016-11-18
@webinar

All padding is css.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question