axlsx icon indicating copy to clipboard operation
axlsx copied to clipboard

Axlsx indent not working

Open BigMcLargeHuge opened this issue 4 years ago • 1 comments

I'm attempting to add an indent to a cell using Axlsx in a rails app but am apparently failing. From what I've read in the documentation and a few other pages this should be done in the following way.

@indent_1 = worksheet.styles.add_style :alignment => { :indent => 1 }

sheet.add_row ['pcd.1 - Dealer Support for Membership in Professional Design Organization'].concat([nil] * 6).concat([design_detail.maximum(:dealer_support_membership_metric).to_s.capitalize,
totals[:dealer_support_membership], nil,
scores[:dealer_support_membership], nil]),
style: @indent_1

However, no indent is appearing. I'm not quite clear on the units of the :indent integer but I've tried 1, 10, and 20 with no apparent difference.

I'm running rails 4.2.1 ruby 2.2.0 axlsx 1.3.6

BigMcLargeHuge avatar Jun 01 '21 18:06 BigMcLargeHuge

I assume you're not still looking for a solution to this, but in case anyone else is: you also need to specify horizonal alignment like so: :alignment => {:horizontal => :left, :indent => 1}

remcode-remco avatar Nov 21 '22 09:11 remcode-remco