我正在使用 jquery Datatable 插件,并按照我如何将表格从网页导出到 excel在我的表格上方添加几个按钮(复制/csv/excel/pdf/print),但导出操作(复制&csv&excel&pdf)对我不起作用,以下是我的主要代码:
<head>
<style type="text/css" title="currentStyle">
@import "../../media/css/demo_page.css";
@import "../../media/css/demo_table.css";
@import "media/css/TableTools.css";
</style>
<script type="text/javascript" charset="utf-8" src="../../media/js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../../media/js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8" src="media/js/ZeroClipboard.js"></script>
<script type="text/javascript" charset="utf-8" src="media/js/TableTools.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready( function () {
$('#example').dataTable( {
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "/swf/copy_cvs_xls_pdf.swf"
}
});
});
</script>
</head>
有什么帮助吗?另外:我想做的是让这些按钮在此页面中作为“复制/打印/保存”工作