![]() |
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 DataTable also exposes a powerful API that can be further used to modify how the data is displayed.
The tabIndex option is used to specify the flow order by which the controls of the table are selectable on the page. This option can be used to overrule this flow and change the way by which the keyboard is used to interact with the page. By default, a DataTable will have a tabIndex already assigned to it so that the controls are accessible without the use of the mouse.
The value of -1 will mean that the table's built-in navigation will be disabled and prevent the use of the keyboard to navigate the page.
{ tabIndex: value }
Parameters: This option has a single value as mentioned above and described below.
The example below illustrate the use of this option.
Example 1: In this example, the first table has the tabIndex set to 2 and the second table has to be tabIndex set to 1, therefore the second table's controls are selected before the first table.
Output:
👁 ImageExample 2: In this example, the first table has the tabIndex set to -1, therefore the first table is not selectable in the flow of the document.
Output:
Reference: