class Axlsx::CellAlignment

Using Styles#add_style is the recommended way to manage cell alignment.

CellAlignment stores information about the cell alignment of a style Xf Object.

Create a new cell_alignment object


  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • horizontal (Symbol)
  • vertical (Symbol)
  • text_rotation (Integer)
  • wrap_text (Boolean)
  • indent (Integer)
  • relative_indent (Integer)
  • justify_last_line (Boolean)
  • shrink_to_fit (Boolean)
  • reading_order (Integer)

The horizontal cell alignement style must be one of


The horizontal alignment of the cell.

The amount of indent

Indicate if the last line should be justified.

The reading order of the text 0 Context Dependent 1 Left-to-Right 2 Right-to-Left

The amount of relativeIndent

Indicate if the text should be shrunk to the fit in the cell.

The textRotation of the cell.

Serializes the object


  • str (String) (defaults to: '')

The vertical cell allingment style must be one of the following:


The vertical alignment of the cell.

Indicate if the text of the cell should wrap

CellAlignment is referenced in 0 repositories