Constants

HORIZONTAL_GENERAL

HORIZONTAL_GENERAL = 'general'

HORIZONTAL_LEFT

HORIZONTAL_LEFT = 'left'

HORIZONTAL_RIGHT

HORIZONTAL_RIGHT = 'right'

HORIZONTAL_CENTER

HORIZONTAL_CENTER = 'center'

HORIZONTAL_CENTER_CONTINUOUS

HORIZONTAL_CENTER_CONTINUOUS = 'centerContinuous'

HORIZONTAL_JUSTIFY

HORIZONTAL_JUSTIFY = 'justify'

HORIZONTAL_FILL

HORIZONTAL_FILL = 'fill'

HORIZONTAL_DISTRIBUTED

HORIZONTAL_DISTRIBUTED = 'distributed'

VERTICAL_BOTTOM

VERTICAL_BOTTOM = 'bottom'

VERTICAL_TOP

VERTICAL_TOP = 'top'

VERTICAL_CENTER

VERTICAL_CENTER = 'center'

VERTICAL_JUSTIFY

VERTICAL_JUSTIFY = 'justify'

VERTICAL_DISTRIBUTED

VERTICAL_DISTRIBUTED = 'distributed'

READORDER_CONTEXT

READORDER_CONTEXT = 0

READORDER_LTR

READORDER_LTR = 1

READORDER_RTL

READORDER_RTL = 2

Properties

$_isSupervisor

$_isSupervisor : boolean

Supervisor?

Type

boolean

$_parent

$_parent : \PHPExcel_Style

Parent. Only used for supervisor

Type

\PHPExcel_Style

$_horizontal

$_horizontal : string

Horizontal alignment

Type

string

$_vertical

$_vertical : string

Vertical alignment

Type

string

$_textRotation

$_textRotation : integer

Text rotation

Type

integer

$_wrapText

$_wrapText : boolean

Wrap text

Type

boolean

$_shrinkToFit

$_shrinkToFit : boolean

Shrink to fit

Type

boolean

$_indent

$_indent : integer

Indent - only possible with horizontal alignment left and right

Type

integer

$_readorder

$_readorder : integer

Read order

Type

integer

Methods

__construct()

__construct(boolean  $isSupervisor = FALSE, boolean  $isConditional = FALSE) 

Create a new PHPExcel_Style_Alignment

Parameters

boolean $isSupervisor

Flag indicating if this is a supervisor or not Leave this value at default unless you understand exactly what its ramifications are

boolean $isConditional

Flag indicating if this is a conditional style or not Leave this value at default unless you understand exactly what its ramifications are

bindParent()

bindParent(\PHPExcel  $parent,   $parentPropertyName = NULL) : \PHPExcel_Style_Supervisor

Bind parent. Only used for supervisor

Parameters

\PHPExcel $parent
$parentPropertyName

Returns

\PHPExcel_Style_Supervisor

getIsSupervisor()

getIsSupervisor() : boolean

Is this a supervisor or a cell style component?

Returns

boolean

getActiveSheet()

getActiveSheet() : \PHPExcel_Worksheet

Get the currently active sheet. Only used for supervisor

Returns

\PHPExcel_Worksheet

getSelectedCells()

getSelectedCells() : string

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

Returns

string —

E.g. 'A1'

getActiveCell()

getActiveCell() : string

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

Returns

string —

E.g. 'A1'

__clone()

__clone() 

Implement PHP __clone to create a deep clone, not just a shallow copy.

getSharedComponent()

getSharedComponent() : \PHPExcel_Style_Alignment

Get the shared style component for the currently active cell in currently active sheet.

Only used for style supervisor

Returns

\PHPExcel_Style_Alignment

getStyleArray()

getStyleArray(array  $array) : array

Build style array from subcomponents

Parameters

array $array

Returns

array

applyFromArray()

applyFromArray(array  $pStyles = NULL) : \PHPExcel_Style_Alignment

Apply styles from array

$objPHPExcel->getActiveSheet()->getStyle('B2')->getAlignment()->applyFromArray( array( 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, 'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER, 'rotation' => 0, 'wrap' => TRUE ) );

Parameters

array $pStyles

Array containing style information

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Style_Alignment

getHorizontal()

getHorizontal() : string

Get Horizontal

Returns

string

setHorizontal()

setHorizontal(string  $pValue = \PHPExcel_Style_Alignment::HORIZONTAL_GENERAL) : \PHPExcel_Style_Alignment

Set Horizontal

Parameters

string $pValue

Returns

\PHPExcel_Style_Alignment

getVertical()

getVertical() : string

Get Vertical

Returns

string

setVertical()

setVertical(string  $pValue = \PHPExcel_Style_Alignment::VERTICAL_BOTTOM) : \PHPExcel_Style_Alignment

Set Vertical

Parameters

string $pValue

Returns

\PHPExcel_Style_Alignment

getTextRotation()

getTextRotation() : integer

Get TextRotation

Returns

integer

setTextRotation()

setTextRotation(integer  $pValue) : \PHPExcel_Style_Alignment

Set TextRotation

Parameters

integer $pValue

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Style_Alignment

getWrapText()

getWrapText() : boolean

Get Wrap Text

Returns

boolean

setWrapText()

setWrapText(boolean  $pValue = FALSE) : \PHPExcel_Style_Alignment

Set Wrap Text

Parameters

boolean $pValue

Returns

\PHPExcel_Style_Alignment

getShrinkToFit()

getShrinkToFit() : boolean

Get Shrink to fit

Returns

boolean

setShrinkToFit()

setShrinkToFit(boolean  $pValue = FALSE) : \PHPExcel_Style_Alignment

Set Shrink to fit

Parameters

boolean $pValue

Returns

\PHPExcel_Style_Alignment

getIndent()

getIndent() : integer

Get indent

Returns

integer

setIndent()

setIndent(integer  $pValue) : \PHPExcel_Style_Alignment

Set indent

Parameters

integer $pValue

Returns

\PHPExcel_Style_Alignment

getReadorder()

getReadorder() : integer

Get read order

Returns

integer

setReadorder()

setReadorder(integer  $pValue) : \PHPExcel_Style_Alignment

Set read order

Parameters

integer $pValue

Returns

\PHPExcel_Style_Alignment

getHashCode()

getHashCode() : string

Get hash code

Returns

string —

Hash code