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

Explanation for styles per property type #14

Closed
westonganger opened this issue Feb 25, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@westonganger
Copy link
Owner

commented Feb 25, 2016

I am finding it very difficult to style using this gem mainly due to lack of the documentation around the styling. So far I have managed to apply a bold style to a cell.

  1. How to set a cell/columns width? (and maybe how to get the cell /column to autosize?)
  2. How to set a row background color?
@thiagoarrais

This comment has been minimized.

Copy link
Collaborator

commented Mar 31, 2016

This is a really low level library, prior knowledge of the ODF spec is required. I know: that sucks...

What I would do in your case would be to experiment creating and depackaging some ODF files created with Libre Office (or wherever else)... Again: that sucks really bad...

And maybe write a higher level library on top of rODF? Or maybe increment it with a nicer API?

@thiagoarrais

This comment has been minimized.

Copy link
Collaborator

commented Mar 31, 2016

I guess you already solved that row background color problem, right? As given by this PR you opened.

@thiagoarrais

This comment has been minimized.

Copy link
Collaborator

commented Mar 31, 2016

For column width, here's a "hello world" example:

require 'odf/spreadsheet'

ODF::Spreadsheet.file("/tmp/my-spreadsheet.ods") do
  style 'wide-column', :family => :column do
    property :column, 'column-width' => "8.0cm"
  end
  table 'Wide column' do
    column :style => 'wide-column'
    row { cell 'Wiiiiide' }
  end
end

But then again... Auto-sizing would involve some mining in the spec. Sucks!

@westonganger

This comment has been minimized.

Copy link
Owner Author

commented Aug 27, 2016

I am currently in the process of creating the documentation for more styles from the source code of a PHP libarary: https://github.com/box/spout/blob/584121d47887bdfe063c4dfdee24d490e40466d2/src/Spout/Writer/ODS/Helper/StyleHelper.php

@westonganger

This comment has been minimized.

Copy link
Owner Author

commented Dec 3, 2016

All of the styles I could figure out from the above link have been documented in the README.md for v1.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.