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.
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 |