使用这个是因为昨天一个小伙伴问我怎么修改里面的配置,但是我没有用过这个东西,所以就稍微研究了一下。
dataTable使用的时候只需要在table标签中写thead就行,tbody是不需要写的,代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>datatable的使用</title>
<script src="./jQuery.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css" />
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<style>
.abc{
color: red;
}
</style>
</head>
<body>
<table class="table table-bordered table-striped" id="table-main">
<thead>
<tr>
<th>用户名</th>
<th>渠道名</th>
<th>游戏名</th>
<th>结果</th>
<th>耗时</th>
<th>创建时间