Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Axlsx indent not working #661

Open
BigMcLargeHuge opened this issue Jun 1, 2021 · 1 comment
Open

Axlsx indent not working #661

BigMcLargeHuge opened this issue Jun 1, 2021 · 1 comment

Comments

@BigMcLargeHuge
Copy link

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

@remcode-remco
Copy link

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}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants