好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

jquery jtable

jQuery jtable是一个用于创建交互式数据表格的jQuery插件。它可以帮助我们快速创建一个漂亮的、可定制的数据表格,支持分页、排序和筛选等功能。

使用jtable非常简单,只需要引入它的相关文件,然后在HTML中创建一个

标签,然后在JavaScript中调用jtable即可。以下是一个简单的例子:

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="jtable/themes/metro/blue/jtable.min.css" type="text/css" />
<script src="jquery.min.js" type="text/javascript"></script>
<script src="jtable/jquery.jtable.min.js" type="text/javascript"></script>
</head>
<body>
<div id="StudentTableContainer"></div>
<script type="text/javascript">
$(document).ready(function() {
$('#StudentTableContainer').jtable({
title: 'Student List',
paging: true,
pageSize: 10,
sorting: true,
defaultSorting: 'Name ASC',
actions: {
listAction: 'StudentActions.php?action=list',
createAction: 'StudentActions.php?action=create',
updateAction: 'StudentActions.php?action=update',
deleteAction: 'StudentActions.php?action=delete'
},
fields: {
StudentId: {
key: true,
create: false,
edit: false,
list: false
},
Name: {
title: 'Name',
width: '30%'
},
Age: {
title: 'Age',
width: '20%'
},
Gender: {
title: 'Gender',
width: '20%',
options: {'M': 'Male', 'F': 'Female'}
},
Country: {
title: 'Country',
width: '30%',
options: {'USA': 'United States', 'CA': 'Canada', 'UK': 'United Kingdom'}
}
}
});
$('#StudentTableContainer').jtable('load');
});
</script>
</body>
</html>

以上代码将创建一个包含学生信息的表格,其中包含姓名、年龄、性别和国家等字段。该表格支持分页、排序和筛选等功能。

总之,jQuery jtable是一个非常实用的jQuery插件,可以帮助我们快速创建漂亮的数据表格,提高开发效率。

查看更多关于jquery jtable的详细内容...

  阅读:20次

上一篇: jquery keyup 按键

下一篇:jquery js路径