![]() |
VOOZH | about |
DataTables is a jQuery plugin that can be used for adding interactive and advanced controls to HTML tables for the webpage. This also allows the data in the table to be searched, sorted, and filtered according to the needs of the user. The DataTables also exposes a powerful API that can be further used to modify how the data is displayed.
The order option is used to specify the rows of the DataTable that have to be ordered and their direction. It accepts a two-dimensional array that allows the ordering to be specified in multiple columns at once. The column defined first would be given more priority in sorting. The default value is [[0, 'asc']], which means that only the first column is sorted in ascending order.
Syntax:
{ order: value }
Parameters: This option has a single value as mentioned above and described below.
Example 1: In this example, the 3rd column is sorted in ascending order.
Output:
👁 ImageExample 2: In this example, the 1st column is sorted in ascending order, and then the 2nd column is sorted in descending order.
Output: