Method: Axlsx::Border#initialize

Defined in:
lib/axlsx/stylesheet/border.rb

#initialize(options = {}) ⇒ Border

Note:

The recommended way to manage borders is with Style#add_style

Creates a new Border object

Examples:

  • Making a border
p = Axlsx::Package.new
red_border = p.workbook.styles.add_style :border => { :style => :thin, :color => "FFFF0000" }
ws = p.workbook.add_worksheet
ws.add_row [1,2,3], :style => red_border
p.serialize('red_border.xlsx')

Parameters:

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

    a customizable set of options

Options Hash (options):

  • diagonal_up (Boolean)
  • diagonal_down (Boolean)
  • outline (Boolean)

See Also:

  • Style#add_style


22
23
24
25
# File 'lib/axlsx/stylesheet/border.rb', line 22

def initialize(options={})
  @prs = SimpleTypedList.new BorderPr
  parse_options options
end