为什么我有一个JS错误"i is undefined jquery.datatables.min.js"



这是我的HTML/twig:

<table
class="table table-striped"
data-toggle="datatable"
data-number-rows-display=5
>
<thead>
<tr>
<th data-exportable="true" data-sortable="true">Nom</th>
<th data-exportable="true" data-sortable="true">Prénom</th>
<th data-exportable="true">Téléphone fixe</th>
<th data-exportable="true">Téléphone portable</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{% for individual in people %}
<tr>
<td class="align-middle">{{ individual.lastname }}</td>
<td class="align-middle">{{ individual.firstname }}</td>
<td class="align-middle"><div class="phone">{{ individual.homePhoneNumber }}</div></td>
<td class="align-middle"><div class="phone">{{ individual.cellPhoneNumber }}</div></td>
<td class="align-middle column-action">
<a
href="{{ path('people_edit', { 'id': individual.id }) }}"
class="btn btn-secondary"
data-toggle="modal"
data-target="#information-people-{{ individual.id }}"
>
<i class="icon ion-md-repeat"></i>&nbsp;Relancer
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>

我使用data-toggle="datatable"来切换数组上的数据表。

我的javascript控制台向我抛出了一个警告i is undefined jquery.datatables.min.js。我不明白这意味着什么以及如何解决它。

在通过W3C 验证器传递我生成的 HTML 后,我发现我比<td>有太多<th>(6<th>5<td>(。删除其中一个<th>解决了问题。

相关内容

最新更新