2013-05-08 84 views
0

我正在使用jQuery数据表V 1.9.4。这是我的html代码。jQuery DataTables:标题错误

<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, 

      } 
     ); 

我的问题是数据表头出现两次。如何解决这个问题呢。提前致谢。 enter image description here

+0

u能显示JS import语句 – PSR 2013-05-08 12:54:54

+0

<脚本类型= “文/ JavaScript的” \t SRC = “jQuery的1.9.0.js”> \t \t <脚本类=“jsbin” \t src =“jquery.dataTables.nightly.js”> 2013-05-08 12:57:33

回答

-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>