简体   繁体   English

DataTables表未显示

[英]DataTables table not displaying

I'm attempting to make use of the DataTables plugin, and when using the example code on https://datatables.net/examples/data_sources/js_array.html as a starting point I'm having difficulty having the table display, if any suggestions could be made where I'm going wrong. 我正在尝试使用DataTables插件,并且在https://datatables.net/examples/data_sources/js_array.html上使用示例代码作为起点时,我很难显示表(如果有)可以提出我要去哪里的建议。

<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <title>DataTables Site</title>
    <meta name="viewport" content="width=device-width, minimum-scale-1.0, maximum-scale=1.0" />
    <link rel="stylesheet" href="jquery.DataTables.min.css">
    <link rel="stylesheet" href="styles.css">
    <link rel="stylesheet" href="DataTablesCSS.css">
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.15/datatables.min.css"/>
</head>

<body>

<script src="DataTablesJS.js"></script>
<script src="jquery.dataTables.min.js"></script>
<script src="jquery-1.12.0.min.js"</script>
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.10.15/datatables.min.js"></script>
<script type="text/javascript" class="init"></script>

<div id="container" class="width">
<header>
    <h1>Data<span> Tables</span></h1>
</header>

<div id="body">
<section id="content">
    <br>
    <article>
        <h2>DataTables H2</h2>
        </br>
<html>
<body>

<div>
<table id="example" class="display" width="100%"></table>
</div>

</body>
</html>
    </article>

</section>
<div class="clear"></div>
</div>
<footer>

</footer>
</div>
</body>
</html>

Thanks in advance, let me know if adding in the CSS, or javascript files would be useful. 预先感谢,让我知道添加CSS或javascript文件是否有用。

First of all, please try using some HTML code validator like: https://validator.w3.org/ 首先,请尝试使用一些HTML代码验证器,例如: https : //validator.w3.org/

It might not be about DataTables. 它可能与数据表无关。

Use some reasonable IDE (it might be helpful) or command-line validation tool to get quick info on errors. 使用一些合理的IDE(可能会有所帮助)或命令行验证工具来获取有关错误的快速信息。

而是在正文末尾包含javascript数据表,这样,在js可以搜索表之前就生成了HTML。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM