bootstrap datatables前端分页

参考链接 http://datatables.club/

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<!--第一步:引入Javascript / CSS (CDN)-->
		<!-- DataTables CSS -->
		<link rel="stylesheet" type="text/css" href="http://cdn.datatables.net/1.10.21/css/jquery.dataTables.css">
		 
		<!-- jQuery -->
		<script type="text/javascript" charset="utf8" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
		 
		<!-- DataTables -->
		<script type="text/javascript" charset="utf8" src="http://cdn.datatables.net/1.10.21/js/jquery.dataTables.js"></script>
	</head>
	<body>
		<!--第二步:添加如下 HTML 代码-->
		<table id="table_id_example" class="display">
		    <thead>
		        <tr>
		            <th>Column 1</th>
		            <th>Column 2</th>
		        </tr>
		    </thead>
		    <tbody>
		        <tr>
		            <td>Row 1 Data 1</td>
		            <td>Row 1 Data 2</td>
		        </tr>
		        <tr>
		            <td>Row 2 Data 1</td>
		            <td>Row 2 Data 2</td>
		        </tr>
				<tr>
				    <td>Row 2 Data 1</td>
				    <td>Row 2 Data 2</td>
				</tr>
				<tr>
				    <td>Row 2 Data 1</td>
				    <td>Row 2 Data 2</td>
				</tr>
				<tr>
				    <td>Row 2 Data 1</td>
				    <td>Row 2 Data 2</td>
				</tr>
				<tr>
				    <td>Row 2 Data 1</td>
				    <td>Row 2 Data 2</td>
				</tr>
				<tr>
				    <td>Row 2 Data 1</td>
				    <td>Row 2 Data 2</td>
				</tr>
				<tr>
				    <td>Row 2 Data 1</td>
				    <td>Row 2 Data 2</td>
				</tr>
				<tr>
				    <td>Row 2 Data 1</td>
				    <td>Row 2 Data 2</td>
				</tr>
				<tr>
				    <td>Row 2 Data 1</td>
				    <td>Row 2 Data 2</td>
				</tr>
				<tr>
				    <td>Row 2 Data 1</td>
				    <td>Row 2 Data 2</td>
				</tr>
				<tr>
				    <td>Row 2 Data 1</td>
				    <td>Row 2 Data 2</td>
				</tr>
				<tr>
				    <td>Row 2 Data 1</td>
				    <td>Row 2 Data 2</td>
				</tr>
				<tr>
				    <td>Row 2 Data 1</td>
				    <td>Row 2 Data 2</td>
				</tr>
		    </tbody>
		</table>
	</body>
	<script>
		 
		<!--第三步:初始化Datatables-->
		$(document).ready( function () {
		    $('#table_id_example').DataTable({
            "paging": true,
            "lengthChange": false,
            "searching": false,
            "ordering": false,
            "processing": true,
            "info": true,
            "autoWidth": false,
            "responsive": false,
            "serverSide": false,
            "deferRender": true,
            "language": {
                "processing": "处理中...",
                "lengthMenu": "显示 _MENU_ 项结果",
                "zeroRecords": "没有匹配结果",
                "info": "显示第 _START_ 至 _END_ 项结果,共 _TOTAL_ 项",
                "infoEmpty": "显示第 0 至 0 项结果,共 0 项",
                "infoFiltered": "(由 _MAX_ 项结果过滤)",
                "infoPostFix": "",
                "search": "搜索:",
                "searchPlaceholder": "搜索...",
                "url": "",
                "emptyTable": "表中数据为空",
                "loadingRecords": "载入中...",
                "infoThousands": ",",
                "paginate": {
                    "first": "首页",
                    "previous": "上页",
                    "next": "下页",
                    "last": "末页"
                },
                "aria": {
                    "paginate": {
                        "first": "首页",
                        "previous": "上页",
                        "next": "下页",
                        "last": "末页"
                    },
                    "sortAscending": "以升序排列此列",
                    "sortDescending": "以降序排列此列"
                },
                "thousands": "."
            },
        });
		} );
		
		
	</script>
</html>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值