1
我使用我的表bootstrap 3 accordion和DataTables,但我不能似乎初始化引導手風琴引導手風琴+數據表
裏面的DataTable假設下表是自舉手風琴內
<table class="table table-bordered table-hover" class="materialTable">
<thead>
<tr>
<th>#</th>
<th>Test</th>
</tr>
</thead>
<tbody>
<tr>
<td>#</td>
<td>Test</td>
</tr>
</tbody>
</table>
這裏是我如何嘗試初始化表
$(function() {
$('.materialTable').dataTable({
"aoColumnDefs": [{ "sClass": "text-center", "aTargets": [ 0,8 ] },
{ 'bSortable': false, 'aTargets': [ 8 ] }],
});
});
但沒有奏效。
http://jsfiddle.net/manedeepak08/eV37v/ –
我用類,因爲該表是不止一個。如果我使用ID,稍後處理表格會更加複雜。 – newbie
只有在添加此屬性後,纔可以使用class,但只能在html中使用。你在一個標籤中添加了兩次。 –