![]() |
VOOZH | about |
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 autoWidth option is used to specify whether the automatic calculation of the column width in the DataTable is enabled or not. This calculation takes a little time and may be disabled when the column widths are explicitly passed using the columns.width option.
Syntax:
{ autoWidth: value }
Parameters: This option has a single value as mentioned above and described below:
The examples below illustrate the use of this option.
Example 1: In this example, the autoWidth option is set to its default state, which means that the column widths will be calculated automatically.
Output:
👁 ImageExample 2: In this example, the autoWidth option is set to false and the column widths are passed as an array.
Output:
👁 ImageReference: https://datatables.net/reference/option/autoWidth