jQuery数据表响应不支持Boostrap 3
jQuery DataTable responsive doesnt work with Boostrap 3
当我使用DataTable js插件时,我有响应式布局的问题。它不会显示它,即使有响应:true。我试着用css (white-space: nowrap)操作,但这不是解决方案。下面是代码预览。
HTML <table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<th class="no-sort"></th>
<th>Product</th>
<th>Product Category</th>
<th>Views</th>
<th>Average View Time</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-center">1</td>
<td>Accu-Pass Suture Shuttle</td>
<td>Suture Shuttle</td>
<td>1,500 views</td>
<td>8:38 minutes</td>
</tr>
</tbody>
</table>
JS
$('#example1').DataTable({
responsive: true,
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"info": false,
"autoWidth": true,
});
小提琴
在您的Fiddle示例中,您缺少Jquery和datatable插件。
使用Jquery和数据库插件的例子:https://jsfiddle.net/n2vbzn8g/2/
JQuery$(document).ready(function() {
$('#example1').DataTable( {
responsive: true,
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
"paging": false,
"lengthChange": true,
"searching": false,
"ordering": false,
"info": false,
"autoWidth": true
} );
} );
表<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<th class="no-sort"></th>
<th>Product</th>
<th>Product Category</th>
<th>Views</th>
<th>Average View Time</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-center">1</td>
<td>Accu-Pass Suture Shuttle</td>
<td>Suture Shuttle</td>
<td>1,500 views</td>
<td>8:38 minutes</td>
</tr>
</tbody>
</table>
相关文章:
- 任何浏览器都不支持javascript函数
- 对象不支持属性或方法“自动完成”
- 对象没有'不支持set_viewXML
- 您的平台不支持RxJS-Array.observe
- 错误:语法错误,无法识别的表达式:不支持的伪:无效/RectJS/Unit Testing
- 使用Facebook登录,但仍然可以获得:“;此标识池不支持未经身份验证的访问“;
- 415(不支持的媒体类型)错误
- 字符串替换-不支持格式字符'}'
- CSS3卡翻转动画,检测是否不支持
- IE中不支持JQuery window.location.hash
- javascript表单字段submit:Object dos'在IE8中不支持此属性或方法
- 对象不支持对象IE 8
- 不支持Three.js FBX二进制格式
- 使用gmail-api发送电子邮件错误:此api不支持解析表单编码的输入
- 如何在不支持HTML字符的邮件正文中发送%签名
- 在粘贴到文本字段Jquery时检查并突出显示不支持的特殊字符
- 如何从 MVC4 链接调用 Javascript 方法(错误 JavaScript 运行时错误:对象不支持此操作)
- JSHint 错误“对象不支持此属性或方法”用于 javascript 闭包
- 对象不支持属性或方法“确认”
- jQuery数据表响应不支持Boostrap 3