Method: Axlsx::Col#update_width

Defined in:
lib/axlsx/workbook/worksheet/col.rb

#update_width(cell, fixed_width = nil, use_autowidth = true) ⇒ Object

updates the width for this col based on the cells autowidth and an optionally specified fixed width to this value and the cell's attributes are ignored. autowidth value will be ignored.

Parameters:

  • cell (Cell)

    The cell to use in updating this col's width

  • fixed_width (Integer) (defaults to: nil)

    If this is specified the width is set

  • use_autowidth (Boolean) (defaults to: true)

    If this is false, the cell's



113
114
115
116
117
118
119
# File 'lib/axlsx/workbook/worksheet/col.rb', line 113

def update_width(cell, fixed_width=nil, use_autowidth=true)
   if fixed_width.is_a? Numeric
     self.width = fixed_width
   elsif use_autowidth
    self.width = [width || 0, cell.autowidth || 0].max
   end 
end