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.
128 129 130 131 132 133 134 135 |
# File 'lib/axlsx/workbook/worksheet/col.rb', line 128 def update_width(cell, fixed_width=nil, use_autowidth=true) if fixed_width.is_a? Numeric self.width = fixed_width elsif use_autowidth cell_width = cell.autowidth self.width = cell_width unless (width || 0) > (cell_width || 0) end end |