table手机端自动变为ul

插件特效
2026-07-26 03:51 6 次浏览 • 0 次下载 1.4KB
table手机端自动变为ul

使用方法

引用jQuery和table.js

1
2
<script src="js/table.js"></script>

html

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<div class="table-list">
<table>
<thead>
<tr>
<th>标题1</th>
<th>标题2</th>
<th>标题3</th>
<th>标题4</th>
<th>标题5</th>
</tr>
</thead>
<tbody>
<tr>
<td>内容1</td>
<td>内容2</td>
<td>内容3</td>
<td>内容4</td>
<td>内容5</td>
</tr>
</tbody>
</table>
</div>

调用插件

1
$(".table-list").setTable();