我正在使用jQuery數據表https://www.datatables.net/。 我只是想知道是否必須導入//cdn.datatables.net/1.10.11/css/jquery.dataTables.min.css?我剛剛進口https://cdn.datatables.net/1.10.11/js/jquery.dataTables.min.js。它似乎也起作用。我應該導入什麼來使用jquery數據表?
以下是我的網頁在Firefox上的一段源代碼。
<table id="reportsTable" class="table dataTable no-footer" role="grid" aria-describedby="reportsTable_info">
<thead>
<tr role="row">
<th class="col-md-5 sorting_asc" tabindex="0" aria-controls="reportsTable" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Report Name: activate to sort column descending" style="width: 655px;">Report Name</th>
<th class="col-md-2 sorting" tabindex="0" aria-controls="reportsTable" rowspan="1" colspan="1" aria-label="Created Date: activate to sort column ascending" style="width: 240px;">Created Date</th>
<th class="col-md-2 sorting" tabindex="0" aria-controls="reportsTable" rowspan="1" colspan="1" aria-label="Last Modified Date: activate to sort column ascending" style="width: 240px;">Last Modified Date</th>
<th class="col-md-2 thead-schedule sorting_disabled" rowspan="1" colspan="1" aria-label="Scheduling" style="width: 240px;">Scheduling</th>
<th class="col-md-1 sorting_disabled" rowspan="1" colspan="1" aria-label="" style="width: 101px;"></th>
</tr>
</thead>
<tbody id="reportTableBody">
<tr class="report-entry odd" role="row">
<td class="sorting_1"><a href="reports/135">dddd123678</a></td>
<td>
<time>4/13/2016, 14:41</time>
</td>
<td>
<time>4/14/2016, 14:02</time>
</td>
</tr>
</tbody>
</table>
哪裏CSS類(如scending,sorting_asc,reportsTable_info,..)從何而來?
目前還不清楚你在說什麼。 *輸出的html包含在css文件中定義的css標記。*你能分享那個輸出代碼嗎? – Aziz
@Aziz我的問題是:爲什麼一些css標籤在輸出html文件中生成,但只有js文件導入和('#example').DataTable()被調用。 – BAE