私はdataTablesプラグインを使用しています。 indexではなく、列のクラス名で初期ソートを制御したいと考えています。
私はこの解決策を見つけました:http://live.datatables.net/awunaw/edit#javascript,htmltable
しかし、同じページに複数あるため、うまくいきません。
編集:
<table class="dataTables" >
<thead>
<th>Num</th>
<th class="defaultSort">Date</th>
</thead>
<tbody>
<tr>
<td>11</td> <td>1/1/13</td>
</tr>
</tbody>
</table>
<table class="dataTables" >
<thead>
<th class="defaultSort">Num</th>
<th>Date</th>
</thead>
<tbody>
<tr>
<td>11</td> <td>1/1/13</td>
</tr>
<tbody>
</table>
jQuery('table.dataTable').dataTable(dataTablesDefaultOption);