Method: Axlsx::Worksheet#col_style
- Defined in:
- lib/axlsx/workbook/worksheet/worksheet.rb
#col_style(index, style, options = {}) ⇒ Object
Note:
You can also specify the style for specific columns in the call to add_row by using an array for the :styles option
Set the style for cells in a specific column
531 532 533 534 535 |
# File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 531 def col_style(index, style, ={}) offset = .delete(:row_offset) || 0 cells = @rows[(offset..-1)].map { |row| row[index] }.flatten.compact cells.each { |cell| cell.style = style } end |