### Initialize colResizable on tables Source: https://github.com/alvaro-prieto/colresizable/blob/master/readme.md Add a script reference to colResizable.min.js in the head after jQuery is loaded, then apply the colResizable() method to a table or collection of tables using a jQuery wrapper. ```javascript $(function(){ $("table").colResizable(); }); ``` -------------------------------- ### Range slider initialization and onSlide callback Source: https://github.com/alvaro-prieto/colresizable/blob/master/samples/rangeSlider.Demo/range.html Initializes colResizable on a table with id 'range', enabling live drag, a custom dragging class, a grip inner HTML, and an onResize callback that calculates and displays column width percentages. The callback updates the '#text' element with the computed ranges. ```javascript $(function(){ //callback function var onSlide = function(e){ var columns = $(e.currentTarget).find("td"); var ranges = [], total = 0, i, s ="Ranges: ", w; for(i = 0; i", onResize:onSlide, minWidth:8 }); }); ``` -------------------------------- ### colResizable() Source: https://github.com/alvaro-prieto/colresizable/blob/master/readme.md Initializes the colResizable plugin on one or more table elements. This method enhances the table(s) with column resizing functionality. ```APIDOC ## colResizable() ### Description Initializes the colResizable plugin on one or more table elements. This method enhances the table(s) with column resizing functionality. ### Method colResizable() ### Usage $(function(){ $("table").colResizable(); }); ### Parameters #### Options (object) - Optional - **resizeMode** (string) - Optional - Default: 'fit'. Values: 'fit', 'flex', 'overflow'. Determines how resizing works. - **disable** (boolean) - Optional - Default: false. When true, removes all previously added enhancements. - **disabledColumns** (array of int) - Optional - Default: []. Array of column indexes to exclude from manual dragging. - **liveDrag** (boolean) - Optional - Default: false. When true, updates table layout while dragging. - **postbackSafe** (boolean) - Optional - Default: false. Preserves column widths after postback or refresh. - **partialRefresh** (boolean) - Optional - Default: false. Set to true if table is inside an updatePanel or partial refresh. - **useLocalStorage** (boolean) - Optional - Default: false. Store widths in localStorage instead of sessionStorage. - **innerGripHtml** (string) - Optional - Default: empty string. HTML for column grips. - **draggingClass** (string) - Optional - Default: internal css class. CSS class for column anchors while dragging. - **minWidth** (number) - Optional - Default: 15. Minimum column width in pixels. - **headerOnly** (boolean) - Optional - Default: false. Prevent vertical expansion of column anchors. - **hoverCursor** (string) - Optional - Default: "e-resize". Cursor when hovering over column anchors. - **dragCursor** (string) - Optional - Default: "e-resize". Cursor while resizing a column. - **flush** (boolean) - Optional - Default: false. (No description provided) ### Response No return value; enhances the table(s) with resizing functionality. ``` -------------------------------- ### onResize Source: https://github.com/alvaro-prieto/colresizable/blob/master/readme.md Callback function fired when the user has ended dragging a column anchor, altering the previous table layout. The callback can access the updated table via the currentTarget attribute of the event parameter. ```APIDOC ## onResize ### Description Callback function fired when the user has ended dragging a column anchor, altering the previous table layout. The callback can access the updated table via the currentTarget attribute of the event parameter. ### Type callback function ### Default null ### Version 1.0 ### Parameters - **event** (Event) - The event object; the updated table is available via `event.currentTarget`. ``` -------------------------------- ### fixed Source: https://github.com/alvaro-prieto/colresizable/blob/master/readme.md Sets how the resize method works. In fixed mode, resizing a column does not alter total table width; in non-fixed mode, the table can change its width and columns resize independently. ```APIDOC ## fixed ### Description Sets how the resize method works. In fixed mode, resizing a column does not alter total table width; in non-fixed mode, the table can change its width and columns resize independently. ### Type boolean ### Default true ### Version 1.5 only ### Deprecated Use "mode" instead. ### Usage Set to true for fixed mode (default) or false to allow independent column resizing. ### Note There is a known issue where the CSS property `table-layout: fixed;` causes a minor conflict with resizing table widths. The `fixed` setting is different from the CSS property and it is encouraged not to apply that style to your tables. ``` -------------------------------- ### marginLeft Source: https://github.com/alvaro-prieto/colresizable/blob/master/readme.md Specifies the margin-left CSS rule value for the target table to ensure proper resizing behavior. This attribute is required when the table has an explicit margin-left CSS rule. ```APIDOC ## marginLeft ### Description Specifies the margin-left CSS rule value for the target table to ensure proper resizing behavior. This attribute is required when the table has an explicit margin-left CSS rule. ### Type string / null ### Default null ### Version 1.3 ### Usage Set this attribute to the same value as the table's margin-left CSS rule (e.g., "auto", "20%", "10px"). ``` -------------------------------- ### marginRight Source: https://github.com/alvaro-prieto/colresizable/blob/master/readme.md Specifies the margin-right CSS rule value for the target table to ensure proper resizing behavior. This attribute behaves exactly like marginLeft but for the right margin. ```APIDOC ## marginRight ### Description Specifies the margin-right CSS rule value for the target table to ensure proper resizing behavior. This attribute behaves exactly like marginLeft but for the right margin. ### Type string / null ### Default null ### Version 1.3 ### Usage Set this attribute to the same value as the table's margin-right CSS rule (e.g., "auto", "20%", "10px"). ``` -------------------------------- ### onDrag Source: https://github.com/alvaro-prieto/colresizable/blob/master/readme.md Callback function fired while dragging a column anchor if liveDrag is enabled. Useful when the table is used as a multiple range slider. The callback can access the updated table via the currentTarget attribute of the event parameter. ```APIDOC ## onDrag ### Description Callback function fired while dragging a column anchor if liveDrag is enabled. Useful when the table is used as a multiple range slider. The callback can access the updated table via the currentTarget attribute of the event parameter. ### Type callback function ### Default null ### Version 1.1 ### Parameters - **event** (Event) - The event object; the updated table is available via `event.currentTarget`. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.