日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

AdminLTE组件之表格DataTable

發(fā)布時間:2025/5/22 编程问答 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 AdminLTE组件之表格DataTable 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

html內(nèi)容:

<div class="box box-primary"><div class="box-header"><h3 class="box-title">表格大標題</h3></div><!-- /.box-header --><div class="box-body"><table id="example1" class="table table-bordered table-striped"><thead><tr class="text-center"><th class="text-center"><button type="button" class="btn btn-default btn-sm checkbox-toggle"><iclass="fa fa-square-o"></i></button></th><th class="text-center">列標題</th><th class="text-center">列標題</th></tr></thead><tbody><tr><td class="text-center">內(nèi)容</td><td class="text-center">內(nèi)容</td></tr></tbody><tfoot></tfoot></table></div><!-- /.box-body --></div>

js部分:

首先要引入AdminLTE的基本文件及表格有關(guān)的文件:

表格有關(guān)文件:

<!-- DataTables --> <link rel="stylesheet"href="{% static '' %}AdminLTE-2.4.12/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css"> <script src="{% static '' %}AdminLTE-2.4.12/bower_components/datatables.net/js/jquery.dataTables.min.js"></script> <script src="{% static '' %}AdminLTE-2.4.12/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>

?

js代碼方面:默認都是開啟,如果是向開啟,則需要進行設(shè)置。 $(function () {$('#example1').DataTable({'paging': false, //關(guān)閉頁碼'lengthChange': false,//關(guān)閉每頁顯示多少個選項'info':false,//關(guān)閉頁碼底端信息'searching':false,//關(guān)閉搜索欄'ordering':false//關(guān)閉列排序});

?

由于頁面都是英文顯示,所以也可以對表格的字進行修改: $('#example1').DataTable({"pagingType": "full_numbers", //顯示尾頁和首頁"language": {//"info": "當前第_PAGE_頁,共 _PAGES_頁","sInfo": "當前顯示第 _START_ 到第 _END_ 條,共 _TOTAL_ 條","sInfoFiltered": "(從_MAX_條篩選 )","sInfoEmpty": "共篩選到0條","sSearch": "搜索:","sLengthMenu": "每頁顯示 _MENU_ 條","sZeroRecords": "未篩選到相關(guān)內(nèi)容","paginate": {"sFirst": "首頁", //首頁和尾頁必須在pagingType設(shè)為full_numbers時才可以"sLast": "尾頁","sPrevious": "上一頁","sNext": "下一頁","first": "First page","last": "Last page","next": "Next page","previous": "Previous page"}}});})

?更多參見:https://datatables.net/examples/styling/bootstrap.html

轉(zhuǎn)載于:https://www.cnblogs.com/ohahastudy/p/11576157.html

總結(jié)

以上是生活随笔為你收集整理的AdminLTE组件之表格DataTable的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。