Determine how much each column's css width will need to change. Sizes = result = pixels widths OR percentage based widths
341692
function determineDeltas(sizes, column, step, min, isPercentageBased) {

        var result = sizes.slice(0);

        function generateZeros(array) {
          return Tools.map(array, function () {
            return 0;
          });
        }

        function onOneColumn() {
          var deltas;
          if (isPercentageBased) {
            // If we have one column in a percent based table, that column should be 100% of the width of the table.
            deltas = [100 - result[0]];
          } else {
            var newNext = Math.max(min, result[0] + step);
            deltas = [newNext - result[0]];
          }
          return deltas;
        }

        function onLeftOrMiddle(index, next) {

          var startZeros = generateZeros(result.slice(0, index));
          var endZeros = generateZeros(result.slice(next + 1));
          var deltas;

          if (step >= 0) {
            var newNext = Math.max(min, result[next] - step);
            deltas = startZeros.concat([step, newNext - result[next]]).concat(endZeros);
          } else {
            var newThis = Math.max(min, result[index] + step);
            var diffx = result[index] - newThis;
            deltas = startZeros.concat([newThis - result[index], diffx]).concat(endZeros);
          }

          return deltas;
        }

        function onRight(previous, index) {
          var startZeros = generateZeros(result.slice(0, index));
          var deltas;

          if (step >= 0) {
            deltas = startZeros.concat([step]);
          } else {
            var size = Math.max(min, result[index] + step);
            deltas = startZeros.concat([size - result[index]]);
          }

          return deltas;

        }

        var deltas;

        if (sizes.length === 0) { // No Columns
          deltas = [];
        } else if (sizes.length === 1) { // One Column
          deltas = onOneColumn();
        } else if (column === 0) { // Left Column
          deltas = onLeftOrMiddle(0, 1);
        } else if (column > 0 && column < sizes.length - 1) { // Middle Column
          deltas = onLeftOrMiddle(column, column + 1);
        } else if (column === sizes.length - 1) { // Right Column
          deltas = onRight(column - 1, column);
        } else {
          deltas = [];
        }

        return deltas;
      }
1353558
function columnGroupWidths(groups, all) {
    return {
        left: columnTotalWidth(groups.left),
        center: columnTotalWidth(groups.center),
        right: columnTotalWidth(groups.right),
        total: Math.floor(columnTotalWidth(all))
    };
}
1171095
void updateWidth() {

        if (formCss().firstColumn().equals(m_compacteModeStyle.getValue())) {
            int width = getElement().getParentElement().getOffsetWidth() - formCss().SECOND_COLUMN_WIDTH();
            // if width could not be evaluated, fall back to a 'save' value
            if (width < 0) {
                width = 400;
            }
            getElement().getStyle().setWidth(width, Unit.PX);
        } else {
            getElement().getStyle().clearWidth();
        }
    }
185039
def _get_column_widths(self):
        """"""
        col_widths = {}
        for table, (row, col) in self.__tables.values():
            for colname, width in table.column_widths.items():
                ic = col + table.get_column_offset(colname)
                current_width = col_widths.setdefault(ic, width)
                col_widths[ic] = max(width, current_width)
        return col_widths
471252
function _minWidth (col) {
  var padding = col.padding || []
  var minWidth = 1 + (padding[left] || 0) + (padding[right] || 0)
  if (col.border) minWidth += 4
  return minWidth
}
901801
def column_width(tokens):
    
    get_len = tools.display_len if PY3 else len
    lens = sorted(map(get_len, tokens or [])) or [0]
    width = lens[-1]

    # adjust for disproportionately long strings
    if width >= 18:
        most = lens[int(len(lens) * 0.9)]
        if most < width + 6:
            return most

    return width
1257510
function() {
        var item,
            span,
            size,
            l = this.items.length;

        this.matrix = [];

        for (var i = 0; i < l; i++) {
            item = this.items.eq(i);
            size = item.data('matrix-column-width');

            // How many columns does this item span?
            span = Math.max(Math.round(size / this.colWidth), 1);

            // Span cannot be larger than the total number of columns
            if (span > this.colCount) {
                span = this.colCount;
            }

            this.matrix.push({
                item: item,
                span: span
            });

            // Multiple columns
            if (span > 1) {
                for (var s = 1; s < span; s++) {
                    if (this.matrix) {
                        this.matrix.push({
                            item: item,
                            span: false // Indicates an empty space
                        });
                    }
                }
            }
        }
    }
772645
function getBordersSize(styles, ...positions) {
    return positions.reduce((size, position) => {
        const value = styles['border-' + position + '-width'];

        return size + toFloat(value);
    }, 0);
}
764567
def max_column_widths(columns, header, opts = {})
      row_column_widths = columns.map do |c| 
        c.reduce(0) { |m, v| [m, v.nil? ? 0 : v.length].max }
      end

      header_column_widths = header.map { |h| h.length }

      row_column_widths = header_column_widths if row_column_widths.empty?

      widths = row_column_widths.zip(header_column_widths).map do |column|
        column.reduce(0) { |m, v| [m, v].max }
      end

      widths.empty? ? [] : scale_widths(widths, opts)
    end
493973
def notify_width_changed(self):
        
        new_table_width = sum([col.width for col in self.columns])
        self._graphic_frame.width = new_table_width
1357349
def change_column_width(column_index, width_in_chars = RubyXL::ColumnRange::DEFAULT_WIDTH)
      change_column_width_raw(column_index, ((width_in_chars + (5.0 / RubyXL::Font::MAX_DIGIT_WIDTH)) * 256).to_i / 256.0)
    end
1219863
def size_col(col)   #:nodoc:
    # Look up the cell value to see if it has been changed
    if @col_sizes[col]
      width = @col_sizes[col]

      # The relationship is different for user units less than 1.
      if width < 1
        (width *12).to_i
      else
        (width *7 +5 ).to_i
      end
    else
      64
    end
  end
391292
def column_width(self, width):
        """"""
        if isinstance(width, int):
            if width >= 0:
                self._column_width = width
            else:
                raise ValueError('Column width must be nonnegative.')
        else:
            raise TypeError('Column width must be a nonnegative integer.')
1015010
function (width, units) {
          width = width.toString();
          units = units || width.replace(/^[-\.\d]+/, '') || '%';
          this.widthUnits = units;
          width = parseFloat(width);

          if (width < 0) {
            return false;
          }

          if (units === '%') {
            width = Math.min(100, width);
            width = Math.max(0, width);
          }
          this.style.width = width + '' + units;
          return true;
        }
1195951
def toggleWidth(self, width):
        ''
        if self.width != width:
            self.width = width
        else:
            self.width = int(options.default_width)
828992
def _calculate_optimal_column_widths(self):
        
        columns = len(self.data[0])  # number of columns
        str_labels = [parse_colorama(str(l)) for l in
                      self.labels]  # labels as strings
        str_data = [[parse_colorama(str(col)) for col in row] for row in
                    self.data]
        # values as strings

        widths = [0] * columns  # length of longest string in each column
        for row in str_data:  # calculate max width in each column
            widths = [max(w, len(c)) for w, c in zip(widths, row)]

        # check if label name is longer than data
        for col, label in enumerate(str_labels):
            if len(label) > widths[col]:
                widths[col] = len(label)

        self.widths = widths
852039
def calculate_columns(self):
        """"""

        self.cols = int(math.ceil(len(self.elements) / float(self.rows)))