Method: Writeexcel::Format#set_center_across
- Defined in:
- lib/writeexcel/format.rb
#set_center_across(arg = 1) ⇒ Object
Implements the Excel5 style “merge”.
Default state: Center across selection is off
Default action: Turn center across on
Valid args: 1
Text can be aligned across two or more adjacent cells using the set_center_across() method. This is an alias for the set_align(‘center_across’) method call.
Only one cell should contain the text, the other cells should be blank:
format = workbook.add_format
format.set_center_across
worksheet.write(1, 1, 'Center across selection', format)
worksheet.write_blank(1, 2, format)
See also the merge1.pl to merge6.rb programs in the examples directory and the merge_range() method.
1000 1001 1002 |
# File 'lib/writeexcel/format.rb', line 1000 def set_center_across(arg = 1) set_text_h_align(6) end |