首页 > 解决方案 > jQuery DataTable 显示条目不起作用

问题描述

当我使用 DataTables 插件时,显示条目似乎不起作用;它只显示“显示条目”但没有下拉菜单。

<!-- datatable-->
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css">
      <script type="text/javascript" charset="utf8" src="https://code.jquery.com/jquery-3.5.1.js"></script>
      <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
      <script>
        $(document).ready( function () {
            $('#statisticforteacher').DataTable({
               "paging":   true,
               "ordering": true,
               "info":     true,
               "pagingType": "full_numbers",
               "bLengthChange": true,
               "iDisplayLength" : 10,
               //"scrollY":        "200px",
               //"scrollCollapse": true,
               // "paging":         false
               select: true
            });
        });
    </script>

如您所见,它显示的条目没有下拉菜单,而且搜索框很大。我在哪里可以修复它并使其适合?

在此处输入图像描述

<table id="statisticforteacher" class="table-responsive" style="width:100%">
    <thead>
    <th>Id</th>
    <th>FrageBezeichnung</th>
    <th>Kapitel</th>
    <th>richtige Antwort</th>
    <th>falsche Antwort</th>
    <th>Richtige Rate</th>
    </thead>
    <tbody>
    @foreach($data as $value)
    <tr>
        <td>{{$value -> Id}}</td>
        <td>{{$value -> FrageBezeichnung}}</td>
        <td>{{$value -> Kapitel}}</td>
        <td>{{$value -> richtigeAntwort}}</td>
        <td>{{$value -> falscheAntwort}}</td>
        <td>{{$value -> richtigeRate}}</td>
    </tr>
    @endforeach
    </tbody>
</table>

标签: jquerylaraveldatatables

解决方案


推荐阅读