src/sap.ui.table/src/sap/ui/table/TableColumnUtils.js
function(oTable, iColumnIndex, iWidth, bFireEvent, iColumnSpan) {
			if (!oTable ||
				iColumnIndex == null || iColumnIndex < 0 ||
				iWidth == null || iWidth <= 0) {
				return false;
			}
			if (iColumnSpan == null || iColumnSpan <= 0) {
				iColumnSpan = 1;
			}
			if (bFireEvent == null) {
				bFireEvent = true;
			}

			var aColumns = oTable.getColumns();
			if (iColumnIndex >= aColumns.length || !aColumns[iColumnIndex].getVisible()) {
				return false;
			}

			var aVisibleColumns = [];
			for (var i = iColumnIndex; i < aColumns.length; i++) {
				var oColumn = aColumns[i];

				if (oColumn.getVisible()) {
					aVisibleColumns.push(oColumn);

					// Consider only the required amount of visible columns.
					if (aVisibleColumns.length === iColumnSpan) {
						break;
					}
				}
			}

			var aResizableColumns = [];
			for (var i = 0; i < aVisibleColumns.length; i++) {
				var oVisibleColumn = aVisibleColumns[i];
				if (oVisibleColumn.getResizable()) {
					aResizableColumns.push(oVisibleColumn);
				}
			}
			if (aResizableColumns.length === 0) {
				return false;
			}

			var iSpanWidth = 0;
			for (var i = 0; i < aVisibleColumns.length; i++) {
				var oVisibleColumn = aVisibleColumns[i];
				iSpanWidth += TableColumnUtils.getColumnWidth(oTable, oVisibleColumn.getIndex());
			}

			var iPixelDelta = iWidth - iSpanWidth;
			var iSharedPixelDelta = Math.round(iPixelDelta / aResizableColumns.length);
			var bResizeWasPerformed = false;

			var oTableElement = oTable.getDomRef();

			// Fix Auto Columns if a column in the scrollable area was resized:
			// Set minimum widths of all columns with variable width except those in aResizableColumns.
			// As a result, flexible columns cannot shrink smaller as their current width after the resize
			// (see setMinColWidths in Table.js).
			if (!TableColumnUtils.TableUtils.isFixedColumn(oTable, iColumnIndex)) {
				oTable._getVisibleColumns().forEach(function(col) {
					var width = col.getWidth(),
						colElement;
					if (oTableElement && aResizableColumns.indexOf(col) < 0 && TableColumnUtils.TableUtils.isVariableWidth(width)) {
						colElement = oTableElement.querySelector("th[data-sap-ui-colid=\"" + col.getId() + "\"]");
						if (colElement) {
							col._minWidth = Math.max(colElement.offsetWidth, TableColumnUtils.getMinColumnWidth());
						}
					}
				});
			}

			// Resize all resizable columns. Share the width change (pixel delta) between them.
			for (var i = 0; i < aResizableColumns.length; i++) {
				var oResizableColumn = aResizableColumns[i];
				var iColumnWidth = TableColumnUtils.getColumnWidth(oTable, oResizableColumn.getIndex());

				var iNewWidth = iColumnWidth + iSharedPixelDelta;
				var iColMinWidth = TableColumnUtils.getMinColumnWidth();
				if (iNewWidth < iColMinWidth) {
					iNewWidth = iColMinWidth;
				}

				var iWidthChange = iNewWidth - iColumnWidth;

				// Distribute any remaining delta to the remaining columns.
				if (Math.abs(iWidthChange) < Math.abs(iSharedPixelDelta)) {
					var iRemainingColumnCount = aResizableColumns.length - (i + 1);
					iPixelDelta -= iWidthChange;
					iSharedPixelDelta = Math.round(iPixelDelta / iRemainingColumnCount);
				}

				if (iWidthChange !== 0) {
					var bExecuteDefault = true;
					var sWidth = iNewWidth + "px";

					if (bFireEvent) {
						bExecuteDefault = oTable.fireColumnResize({
							column: oResizableColumn,
							width: sWidth
						});
					}

					if (bExecuteDefault) {
						oResizableColumn.setWidth(sWidth);
						bResizeWasPerformed = true;
					}
				}
			}

			return bResizeWasPerformed;
		}
function(oTable, iColumnIndex, iWidth, bFireEvent, iColumnSpan) {
			if (!oTable ||
				iColumnIndex == null || iColumnIndex < 0 ||
				iWidth == null || iWidth <= 0) {
				return false;
			}
			if (iColumnSpan == null || iColumnSpan <= 0) {
				iColumnSpan = 1;
			}
			if (bFireEvent == null) {
				bFireEvent = true;
			}

			var aColumns = oTable.getColumns();
			if (iColumnIndex >= aColumns.length || !aColumns[iColumnIndex].getVisible()) {
				return false;
			}

			var aVisibleColumns = [];
			for (var i = iColumnIndex; i < aColumns.length; i++) {
				var oColumn = aColumns[i];

				if (oColumn.getVisible()) {
					aVisibleColumns.push(oColumn);

					// Consider only the required amount of visible columns.
					if (aVisibleColumns.length === iColumnSpan) {
						break;
					}
				}
			}

			var aResizableColumns = [];
			for (var i = 0; i < aVisibleColumns.length; i++) {
				var oVisibleColumn = aVisibleColumns[i];
				if (oVisibleColumn.getResizable()) {
					aResizableColumns.push(oVisibleColumn);
				}
			}
			if (aResizableColumns.length === 0) {
				return false;
			}

			var iSpanWidth = 0;
			for (var i = 0; i < aVisibleColumns.length; i++) {
				var oVisibleColumn = aVisibleColumns[i];
				iSpanWidth += TableColumnUtils.getColumnWidth(oTable, oVisibleColumn.getIndex());
			}

			var iPixelDelta = iWidth - iSpanWidth;
			var iSharedPixelDelta = Math.round(iPixelDelta / aResizableColumns.length);
			var bResizeWasPerformed = false;

			var oTableElement = oTable.getDomRef();

			// Fix Auto Columns if a column in the scrollable area was resized:
			// Set minimum widths of all columns with variable width except those in aResizableColumns.
			// As a result, flexible columns cannot shrink smaller as their current width after the resize
			// (see setMinColWidths in Table.js).
			if (!TableColumnUtils.TableUtils.isFixedColumn(oTable, iColumnIndex)) {
				oTable._getVisibleColumns().forEach(function(col) {
					var width = col.getWidth(),
						colElement;
					if (oTableElement && aResizableColumns.indexOf(col) < 0 && TableColumnUtils.TableUtils.isVariableWidth(width)) {
						colElement = oTableElement.querySelector("th[data-sap-ui-colid=\"" + col.getId() + "\"]");
						if (colElement) {
							col._minWidth = Math.max(colElement.offsetWidth, TableColumnUtils.getMinColumnWidth());
						}
					}
				});
			}

			// Resize all resizable columns. Share the width change (pixel delta) between them.
			for (var i = 0; i < aResizableColumns.length; i++) {
				var oResizableColumn = aResizableColumns[i];
				var iColumnWidth = TableColumnUtils.getColumnWidth(oTable, oResizableColumn.getIndex());

				var iNewWidth = iColumnWidth + iSharedPixelDelta;
				var iColMinWidth = TableColumnUtils.getMinColumnWidth();
				if (iNewWidth < iColMinWidth) {
					iNewWidth = iColMinWidth;
				}

				var iWidthChange = iNewWidth - iColumnWidth;

				// Distribute any remaining delta to the remaining columns.
				if (Math.abs(iWidthChange) < Math.abs(iSharedPixelDelta)) {
					var iRemainingColumnCount = aResizableColumns.length - (i + 1);
					iPixelDelta -= iWidthChange;
					iSharedPixelDelta = Math.round(iPixelDelta / iRemainingColumnCount);
				}

				if (iWidthChange !== 0) {
					var bExecuteDefault = true;
					var sWidth = iNewWidth + "px";

					if (bFireEvent) {
						bExecuteDefault = oTable.fireColumnResize({
							column: oResizableColumn,
							width: sWidth
						});
					}

					if (bExecuteDefault) {
						oResizableColumn.setWidth(sWidth);
						bResizeWasPerformed = true;
					}
				}
			}

			return bResizeWasPerformed;
		}
function ( oTable , iColumnIndex , iWidth , bFireEvent , iColumnSpan ) { if ( ! oTable || iColumnIndex == null || iColumnIndex < 0 || iWidth == null || iWidth <= 0 ) { return false ; } if ( iColumnSpan == null || iColumnSpan <= 0 ) { iColumnSpan = 1 ; } if ( bFireEvent == null ) { bFireEvent = true ; } var aColumns = oTable . getColumns ( ) ; if ( iColumnIndex >= aColumns . length || ! aColumns [ iColumnIndex ] . getVisible ( ) ) { return false ; } var aVisibleColumns = [ ] ; for ( var i = iColumnIndex ; i < aColumns . length ; i ++ ) { var oColumn = aColumns [ i ] ; if ( oColumn . getVisible ( ) ) { aVisibleColumns . push ( oColumn ) ; // Consider only the required amount of visible columns. if ( aVisibleColumns . length === iColumnSpan ) { break ; } } } var aResizableColumns = [ ] ; for ( var i = 0 ; i < aVisibleColumns . length ; i ++ ) { var oVisibleColumn = aVisibleColumns [ i ] ; if ( oVisibleColumn . getResizable ( ) ) { aResizableColumns . push ( oVisibleColumn ) ; } } if ( aResizableColumns . length === 0 ) { return false ; } var iSpanWidth = 0 ; for ( var i = 0 ; i < aVisibleColumns . length ; i ++ ) { var oVisibleColumn = aVisibleColumns [ i ] ; iSpanWidth += TableColumnUtils . getColumnWidth ( oTable , oVisibleColumn . getIndex ( ) ) ; } var iPixelDelta = iWidth - iSpanWidth ; var iSharedPixelDelta = Math . round ( iPixelDelta / aResizableColumns . length ) ; var bResizeWasPerformed = false ; var oTableElement = oTable . getDomRef ( ) ; // Fix Auto Columns if a column in the scrollable area was resized: // Set minimum widths of all columns with variable width except those in aResizableColumns. // As a result, flexible columns cannot shrink smaller as their current width after the resize // (see setMinColWidths in Table.js). if ( ! TableColumnUtils . TableUtils . isFixedColumn ( oTable , iColumnIndex ) ) { oTable . _getVisibleColumns ( ) . forEach ( function ( col ) { var width = col . getWidth ( ) , colElement ; if ( oTableElement && aResizableColumns . indexOf ( col ) < 0 && TableColumnUtils . TableUtils . isVariableWidth ( width ) ) { colElement = oTableElement . querySelector ( "th[data-sap-ui-colid=\"" + col . getId ( ) + "\"]" ) ; if ( colElement ) { col . _minWidth = Math . max ( colElement . offsetWidth , TableColumnUtils . getMinColumnWidth ( ) ) ; } } } ) ; } // Resize all resizable columns. Share the width change (pixel delta) between them. for ( var i = 0 ; i < aResizableColumns . length ; i ++ ) { var oResizableColumn = aResizableColumns [ i ] ; var iColumnWidth = TableColumnUtils . getColumnWidth ( oTable , oResizableColumn . getIndex ( ) ) ; var iNewWidth = iColumnWidth + iSharedPixelDelta ; var iColMinWidth = TableColumnUtils . getMinColumnWidth ( ) ; if ( iNewWidth < iColMinWidth ) { iNewWidth = iColMinWidth ; } var iWidthChange = iNewWidth - iColumnWidth ; // Distribute any remaining delta to the remaining columns. if ( Math . abs ( iWidthChange ) < Math . abs ( iSharedPixelDelta ) ) { var iRemainingColumnCount = aResizableColumns . length - ( i + 1 ) ; iPixelDelta -= iWidthChange ; iSharedPixelDelta = Math . round ( iPixelDelta / iRemainingColumnCount ) ; } if ( iWidthChange !== 0 ) { var bExecuteDefault = true ; var sWidth = iNewWidth + "px" ; if ( bFireEvent ) { bExecuteDefault = oTable . fireColumnResize ( { column : oResizableColumn , width : sWidth } ) ; } if ( bExecuteDefault ) { oResizableColumn . setWidth ( sWidth ) ; bResizeWasPerformed = true ; } } } return bResizeWasPerformed ; }
Resizes one or more visible columns to the specified amount of pixels.

In case a column span is specified:
The span covers only visible columns. If columns directly after the column with index <code>iColumnIndex</code> are invisible they
will be skipped and not be considered for resizing.
The new width <code>iWidth</code> will be equally applied among all resizable columns in the span of visible columns,
considering the minimum column width. The actual resulting width might differ due to rounding errors and the minimum column width.

Resizing of a column won't be performed if the ColumnResize event is fired
and execution of the default action is prevented in the event handler.

@param {sap.ui.table.Table} oTable Instance of the table.
@param {int} iColumnIndex The index of a column. Must the index of a visible column.
@param {int} iWidth The width in pixel to set the column or column span to. Must be greater than 0.
@param {boolean} [bFireEvent=true] Whether the ColumnResize event should be fired. The event will be fired for every resized column.
@param {int} [iColumnSpan=1] The span of columns to resize beginning from <code>iColumnIndex</code>.
@returns {boolean} Returns <code>true</code>, if at least one column has been resized.
Resizes one or more visible columns to the specified amount of pixels .