Release 1.6.1 29 June 2005 |
Developer's reference |
![]() |
Reference > N_XLS_FORMAT > of_set_align |
of_set_align() method
Set the horizontal and vertical text alignment within a cell.
Syntax
format.of_set_align ( alignment ) |
Parameters
Alignment | A string whose value is the alignment method |
Return value
Integer. Returns 1 if it succeeds and -1 if an error occurs.
Description
Valid horizontal alignment: 'left', 'center', 'right', 'fill', 'justify', 'merge'.
Valid vertical alignment: 'top', 'vcenter', 'bottom', 'vjustify'.
The vjustify (vertical justify) option can be used to provide automatic text wrapping in a cell. The height of the cell will be adjusted to accommodate the wrapped text. To specify where the text wraps use the of_set_text_wrap ( ) method.
Examples
format = workbook.of_add_format ( ) format.of_set_align ( 'center' ) format.of_set_align ( 'vcenter' ) worksheet.of_set_row ( 0, 40 ) worksheet.of_write ( 0, 0, 'A', format )
© 2003-2005 Desta, Ltd. All rights reserved. | SupportDesk |