datatables - 数据表:缺少页面元素(排序、搜索、下一个...)
问题描述
我正在设置我的第一个 DataTables 页面,虽然表格显示并格式化,但大多数附加元素都丢失了(排序列、搜索、下一个/上一个...)。我检查了文档,遵循了教程,但仍然卡住了,我只能找到 browserś (Chrome) 浏览器中的一个无法理解的错误。
我的 HTML 文件(从 jinja 模板获取数据):
<head>
<title>Test DataTable</title>
<meta charset="utf-8">
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.22/css/jquery.dataTables.css">
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.22/js/jquery.dataTables.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#example').DataTable();
} );
</script>
</head>
<table id="example" class="display" style="width:100%">
<thead>
<tr>
<th>{{_('Prod Code')}}</></th>
<th>{{_('Description')}}</th>
<th>{{_('Units')}}</th>
<th>{{_('Category')}}</th>
<th></th>
</tr>
</thead>
<tbody>
{% for each_product in products %}
<tr>
<td> {{ each_product.prod_code }} </a></td>
<td> {{ each_product.prod_desc }} </td>
<td> {{ each_product.prod_units }} </td>
<td> {{ each_product.prod_Category }} </td>
</tr>
{% endfor %}
</tbody>
</table>
下面是浏览器中页面的截图。当我将鼠标悬停在它们上方时,这些行变为浅灰色。
有什么我想念的想法吗?
谢谢!
解决方案
推荐阅读
- typescript - 必需的参数需要在构造函数或函数调用中传递
- ldap - 通过证书进行 Apache Directory Studio LDAP 身份验证
- r - 分配多个类时更改变量的类型
- html - 为具有带有 css 选择器的滚动条的 div 应用特定样式
- python - Tensorflow:自定义层输出命名
- php - 本地主机上的邮件联系表
- salesforce - 在 Salesforce 中,如何将新联系人添加到现有帐户?
- optimization - 匹配两个标签之间的两条不同路径。优化
- powershell-5.1 - 在 PowerShell 中从远程服务器复制文件
- python - 笛卡尔图到极坐标图的转换