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'

Properties

$_isSupervisor

$_isSupervisor : bool

Supervisor?

Type

bool

$_parent

$_parent : \PHPExcel_Style

Parent. Only used for supervisor

Type

PHPExcel_Style

$_horizontal

$_horizontal : string

Horizontal

Type

string

$_vertical

$_vertical : string

Vertical

Type

string

$_textRotation

$_textRotation : int

Text rotation

Type

int

$_wrapText

$_wrapText : bool

Wrap text

Type

bool

$_shrinkToFit

$_shrinkToFit : bool

Shrink to fit

Type

bool

$_indent

$_indent : int

Indent - only possible with horizontal alignment left and right

Type

int

Methods

__construct()

__construct(bool  $isSupervisor = FALSE, bool  $isConditional = FALSE) : mixed

Create a new PHPExcel_Style_Alignment

Parameters

bool $isSupervisor

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

bool $isConditional

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

Returns

mixed —

bindParent()

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

Bind parent. Only used for supervisor

Parameters

\PHPExcel $parent
mixed $parentPropertyName

Returns

\PHPExcel_Style_Supervisor —

getIsSupervisor()

getIsSupervisor() : bool

Is this a supervisor or a cell style component?

Returns

bool —

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() : mixed

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

Returns

mixed —

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() : int

Get TextRotation

Returns

int —

setTextRotation()

setTextRotation(int  $pValue) : \PHPExcel_Style_Alignment

Set TextRotation

Parameters

int $pValue

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Style_Alignment —

getWrapText()

getWrapText() : bool

Get Wrap Text

Returns

bool —

setWrapText()

setWrapText(bool  $pValue = FALSE) : \PHPExcel_Style_Alignment

Set Wrap Text

Parameters

bool $pValue

Returns

\PHPExcel_Style_Alignment —

getShrinkToFit()

getShrinkToFit() : bool

Get Shrink to fit

Returns

bool —

setShrinkToFit()

setShrinkToFit(bool  $pValue = FALSE) : \PHPExcel_Style_Alignment

Set Shrink to fit

Parameters

bool $pValue

Returns

\PHPExcel_Style_Alignment —

getIndent()

getIndent() : int

Get indent

Returns

int —

setIndent()

setIndent(int  $pValue) : \PHPExcel_Style_Alignment

Set indent

Parameters

int $pValue

Returns

\PHPExcel_Style_Alignment —

getHashCode()

getHashCode() : string

Get hash code

Returns

string —

Hash code