mirror of
https://github.com/DataTables/DataTables.git
synced 2025-02-28 01:54:15 +01:00
28 lines
956 B
XML
28 lines
956 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><![CDATA[
|
|
|
|
With DataTables you can alter the sorting characteristics of the table at initialisation time. Using the `dt-init sorting` initialisation parameter, you can set the table to display the data exactly how you want.
|
|
|
|
The `dt-init sorting` parameter is an array of arrays where the first value of the inner array is the column to sort on, and the second is 'asc' or 'desc' as required (it is a 2D array to allow multi-column sorting to be defined).
|
|
|
|
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>
|