【发布时间】:2026-01-20 21:15:02
【问题描述】:
我的 HTML 如下所示。
<table id="address_datatable" class="table table-bordered table-striped">
<thead>
<tr>
<th></th>
<th>Company Name</th>
<th>Contact Name</th>
<th>Email Address</th>
<th>Phone Number</th>
<th>Action</th>
</tr>
</thead>
<tbody>
我的 jQuery 代码如下所示
$(document).ready(function() {
$('#address_datatable').DataTable({
"columnDefs": [ {
"targets": [ 0, 2 ],
"orderable": false
} ]
});
});
2 在 "targets" 中工作,但 0 不工作。
我也试过下面的例子。它不工作
$('#example').dataTable( {
"columnDefs": [ {
"targets": 'nosort',
"orderable": false
} ]
} );
为什么会这样?
【问题讨论】:
标签: twitter-bootstrap datatables-1.10