I see methods for col_style and row_style and add_conditional_formatting, but can't figure out how to set just one cell. In my example, col 1 is a date and column 2 is a percent. when i highlight the background of a row, i lose the date/percent formatting because Randy explained a cell can only have 1 style. How do I assign a date_with_background style to just the 1st cell in that row when necessary?
xlsx_package = Stuff.all.to_xlsx
xlsx_package.workbook.worksheets.first.tap do |sheet|
sheet.col_style 0, date_format, {row_offset: 1}
sheet.col_style 1, percent_format, {row_offset: 1}
list_of_my_stuff.each_with_index do |item,index|
if needs_background?(item)
sheet.row_style index+1, with_background
else
sheet.row_style index+1, no_background
end
end
end