0

我正在使用 jQuery 数据表 V 1.9.4。这是我的html代码。

<table id="file_list" class="file_list">
    <thead>
        <tr>
            <th class="rowBorder">File</th>
            <th class="rowBorder">Date</th>
            <th class="rowBorder">Size</th>
            <th class="rowBorder">Type</th>
        </tr>
    </thead>
    <tbody>
    </tbody>

</table>

这是我用于初始化数据表的 js 代码。

oTable = $('#file_list').dataTable(
        {
            "bFilter": false,
            "bInfo": false,
            "iDisplayLength": 50,
            "bLengthChange":false,
            "bPaginate": false,
            "sScrollY": 200,
            "bAutoWidth": false,

            }
        );

我的问题是数据表标题出现两次。如何解决这个问题呢。提前致谢。在此处输入图像描述

4

1 回答 1

-1

我复制了您的代码,它按预期工作。尝试做我做过的事

<!DOCTYPE HTML>
<html>
  <head>
    <title>Sample test</title>
    <script type="text/javascript" src="JavaScript/jquery.js"></script>
    <script type="text/javascript" src="JavaScript/jquery.dataTables.js"></script>
    <script type="text/javascript" charset="utf-8">
    $(document).ready(function(){
        var oTable;
        oTable = $('#file_list').dataTable(
        {
            "bFilter": false,
            "bInfo": false,
            "iDisplayLength": 50,
            "bLengthChange":false,
            "bPaginate": false,
            "sScrollY": 200,
            "bAutoWidth": false,
        });
    });
    </script>   
  </head>
  <body>
    <div id="listbiew" data-role="content"> 
    <table id="file_list" class="file_list">
        <thead>
            <tr>
                <th class="rowBorder">File</th>
                <th class="rowBorder">Date</th>
                <th class="rowBorder">Size</th>
                <th class="rowBorder">Type</th>
            </tr>
        </thead>
        <tbody>
        </tbody>
    </table>
    </div>
  </body>
</html>
于 2013-05-08T13:00:25.813 回答