<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="http://cdn.datatables.net/1.10.20/css/jquery.dataTables.min.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.20/js/jquery.dataTables.min.js"></script>
<script type="text/javascript">
var datares =
{
"content": [
{
"id": "001",
"name": "张三",
"birthday": "2015-12-31"
},
{
"id": "002",
"name": "李四",
"birthday": "2001-11-31"
},
{
"id": "003",
"name": "王五",
"birthday": "2011-12-31"
}
]
};
console.log(datares);
$(document).ready(function () {
$('#myTable').dataTable({
data: datares.content,
columns: [
{"data": 'id'},
{"data": 'name'},
{"data": 'birthday'}
]
});
});
</script>
</head>
<body>
<table id="myTable">
<thead>
<tr>
<th>编号</th>
<th>姓名</th>
<th>出生日期</th>
</tr>
</thead>
</table>
</body>
</html>