2015-10-26 53 views
2

我已经在其上supossed来响应,但其not.Here是我的HTML引导的主题实现的一个jQuery的DataTable ..jQuery的数据表不成为响应

<div class="col-xs-12 table-responsive"> 
      <table class="table table-condensed table-striped table-bordered" id="bttable"> 
       <tfoot> 
        <tr></tr> 
       </tfoot> 
      </table> 
     </div> 

这里是我的jQuery ..

dt = $("#bttable").dataTable({ 
      "data": dataSet, 
      "paging": false, 
      "responsive": true, 
      "stateSave": true, 
      "columns": [ 
       { "title": "<input type='checkbox' id='selectAll'>", "bSortable": false, "width": "5px", }, 
       { "title": "<a href='#' class='btn btn-xs' title='Edit' data-toggle='modal' data-target='#responsive' onclick='edit()'><i class='fa fa-pencil'></i></a>", "bSortable": false, "width": "5px" }, 
       { "title": "FirstName", "width": "50px" }, 
       { "title": "LastName" }, 
       { "title": "Contact Number" }, 
       { "title": "Email ID" } 
      ] 
     }); 

我的小提琴:https://jsfiddle.net/56n6wwd8/

请帮助我,使这个数据表responsive..Thanks ..

+2

你的代码工作正常,看https://jsfiddle.net/56n6wwd8/3/。不要忘记包含响应式扩展,请参见[Download Builder](http://datatables.net/download/index)。 –

回答

3

尝试这样的:

<div class="col-xs-12"> 
<div class="table-responsive"> 
     <table class="table table-condensed table-striped table-bordered" id="bttable"> 
      <tfoot> 
       <tr></tr> 
      </tfoot> 
     </table> 
    </div> 
</div> 
+0

我试了你的答案,但它仍然是..没有帮助.. – Lara

+0

你呢?对这个问题有什么帮助? – Lara

+0

把你的代码在JSFIDDLE ... – Nere