mirror of
https://github.com/DataTables/DataTables.git
synced 2024-12-01 13:24:10 +01:00
22 lines
967 B
XML
22 lines
967 B
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<dt-example table-type="html">
|
|
|
|
<css lib="datatables" />
|
|
<js lib="jquery" />
|
|
<js lib="datatables" />
|
|
|
|
<title>Default sorting</title>
|
|
<js><![CDATA[
|
|
$(document).ready(function() {
|
|
$('#example').dataTable( {
|
|
"sorting": [[ 4, "desc" ]]
|
|
} );
|
|
} );
|
|
]]></js>
|
|
|
|
<info>
|
|
With DataTables you can alter the sorting characteristics of the table at initialisation time. Using the <init>sorting</init> initialisation parameter, you can get the table exactly how you want to present the information. The <init>sorting</init> parameter is an array of arrays where the first value is the column to sort on, and the second is 'asc' or 'desc' as required (it is a double array for <a href="../basic_init/multi_col_sort.html">multi-column sorting</a>). The table below is sorted (descending) by the CSS grade. Note also that the 'Engine version' column is automatically detected as a numeric column and sorted accordingly.
|
|
</info>
|
|
|
|
</dt-example>
|