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

How does row style relates to rich text? #399

Open
sineed opened this issue May 31, 2015 · 0 comments
Open

How does row style relates to rich text? #399

sineed opened this issue May 31, 2015 · 0 comments

Comments

@sineed
Copy link

sineed commented May 31, 2015

Hi! Thank you for awesome gem.

I have one question about usage of rich text. In my project I want to use superscript Excel text feature. Looking for this task led me to this issue #225. For now my implementation looks something like this:

def build_unit(base, exponent)
  unit = Axlsx::RichText.new
  unit.add_run(base)
  unit.add_run(exponent, vertAlign: :superscript)
  unit
end

Then I use this build method in add_row call:

worksheet.add_row(
  [list_number, label, build_unit("m", "3"), value]
  style: [style[:list_number], style[:label], style[:unit], style[:value]]
)

The problem is that style[:unit] doesn't apply to RichText object.

I doesn't know is this a correct behaviour or not, so I wrote two specs which show my assumptions of how this should work. You can see them in this PR #398.

I assume that I can use axlsx api improperly so maybe there is a better solution of assigning rich text run properties from row style.

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

1 participant