gpt4 book ai didi

gridview - 如何使 Yii2 GridView 响应式?

转载 作者:行者123 更新时间:2023-12-02 19:32:17 25 4
gpt4 key购买 nike

我在 Yii2 中有一个常用的 GridView。

<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'tableOptions' => ['class' => 'table table-striped table-bordered table-responsive'],
'columns' => [
'firstName',
'lastName',
[
'attribute' => 'verified',
'format' => 'html',
'value' => function($data){
....
}
],
]
]); ?>

GridView 在移动设备中没有响应。如何使 GridView 页面响应式?

最佳答案

正如 Bootstrap documentation 中所述:

Create responsive tables by wrapping any .table in .table-responsive

所以只需将您的小部件包装在

<div class="table-responsive">
// GridView here
</div>

关于gridview - 如何使 Yii2 GridView 响应式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49207560/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com