pvsaintpe / yii2-float-thead
这是一个为jquery.floatThead编写的Yii 2包装器,它是一个不需要特殊CSS的浮动/锁定/粘性/固定表格头插件,支持窗口和溢出滚动。
1.0.4
2019-01-17 16:10 UTC
Requires
- bluezed/yii2-float-thead: v1.0.9
This package is auto-updated.
Last update: 2024-09-25 08:14:14 UTC
README
这是一个为 jquery.floatThead 编写的Yii 2包装器,它是一个不需要特殊CSS的浮动/锁定/粘性/固定表格头插件,支持窗口和溢出滚动。
安装
安装此扩展的首选方式是通过 composer。
运行以下命令之一
php composer.phar require --prefer-dist pvsaintpe/yii2-float-thead "*"
或者
"pvsaintpe/yii2-float-thead": "*"
将其添加到你的 composer.json
文件的require部分。
如何使用
在你的视图文件中。
<table id="myTable"> <tr> <th>Col1</th> <th>Col2</th> </tr> <tr> <td>Data1</td> <td>Data2</td> </tr> </table> <?php \pvsaintpe\floatthead\FloatThead::widget( [ 'tableId' => 'myTable', 'options' => [ 'top'=>'50' ] ] ); ?>
如果你只想注册资产而不直接将插件应用到表格中,可以使用以下命令
\pvsaintpe\floatthead\FloatThead::widget(['registerOnly'=>true]);