VOOZH about

URL: https://www.geeksforgeeks.org/jquery/datatables-ordercellstop-option/

⇱ DataTables orderCellsTop Option - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

DataTables orderCellsTop Option

Last Updated : 21 Jul, 2021

DataTables is 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 DataTable also exposes a powerful API that can be further used to modify how the data is displayed.

The orderCellsTop option is used to specify in which cell the order event handler will be applied to in the table. This can be used in cases when multiple complex headers are used. Setting the option to true will attach the order event handler to the top unique cell of the table, while setting the option to false will attach it to the bottom cell of the table, which is the default behaviour.

{ orderCellsTop: value }

Parameters: This option has a single value as mentioned above and described below:

  • value: This is a boolean value that is used to specify in which cell of the header the order event handler will be attached. The default value is false.

The examples below illustrate the use of this option.

 

Example 1: In this example, the order event handler will be applied to the top cell of the header.

Output:

👁 Image

Example 2: In this example, the order event handler will be applied to the bottom cell of the header.

Output:

👁 Image

Reference: https://datatables.net/reference/option/orderCellsTop

Comment
Article Tags:

Explore