3

我是一个非常新的程序员,没有任何使用 tabletools 或 swf 路径的经验。我正在尝试实现表格工具来打印/导出/等,但到目前为止只有打印对我有用。大多数解决方案都表示这意味着 swf 路径不正确。但我不知道该放什么作为我的 swf 路径。有人可以帮忙吗?抱歉问了这么一个基本问题。:(

这是我的数据表插件和脚本:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="http://code.jquery.com/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.2/css/jquery.dataTables.css">
<script type="text/javascript" charset="utf8" src="//cdn.datatables.net/1.10.2/js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8" src="https://datatables.net/release-datatables/extensions/TableTools/js/dataTables.tableTools.js"></script>
<link rel="stylesheet" href="https://datatables.net/release-datatables/extensions/TableTools/css/dataTables.tableTools.css" />
<script>
    $(document).ready(function () {
        $('#table_id').DataTable({
            "dom": 'T<"clear">lfrtip',
            "tableTools": {
                "sSwfPath": "/swf/copy_csv_xls_pdf.swf"

            }

        });

    });
</script>
4

1 回答 1

2

您可以在此处浏览tabletools可用的文件cdndatatable tabletools plugin files

通过访问链接,您将找到版本列表,单击其中一个,例如2.2.2

所以向下滚动到底部,看看魔术:

瑞士法郎

//cdn.datatables.net/tabletools/2.2.2/swf/copy_csv_xls.swf //cdn.datatables.net/tabletools/2.2.2/swf/copy_csv_xls_pdf.swf

于 2014-08-28T21:22:55.647 回答