PHPExcel_Style_Alignment

category | PHPExcel
package | PHPExcel_Style
copyright | Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)

### Methods

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

    __clone()

Inherited

inherited_from | \PHPExcel_Style_Supervisor::__clone()

## Create a new PHPExcel_Style_Alignment

    __construct(boolean $isSupervisor, boolean $isConditional)

### Parameters

#### $isSupervisor

`boolean`

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

#### $isConditional

`boolean`

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

## Apply styles from array

    applyFromArray(array $pStyles) : \PHPExcel_Style_Alignment

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

### Parameters

#### $pStyles

`array`

Array containing style information

### Exceptions

`\PHPExcel_Exception` |

### Returns

`\PHPExcel_Style_Alignment`

## Bind parent.

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

Inherited

Only used for supervisor

inherited_from | \PHPExcel_Style_Supervisor::bindParent()

### Parameters

#### $parent

`\PHPExcel`

#### $parentPropertyName

### Returns

`\PHPExcel_Style_Supervisor`

## Get the currently active cell coordinate in currently active sheet.

    getActiveCell() : string

Inherited

Only used for supervisor

inherited_from | \PHPExcel_Style_Supervisor::getActiveCell()

### Returns

`string`E.g. 'A1'

## Get the currently active sheet.

    getActiveSheet() : \PHPExcel_Worksheet

Inherited

Only used for supervisor

inherited_from | \PHPExcel_Style_Supervisor::getActiveSheet()

### Returns

`\PHPExcel_Worksheet`

## Get hash code

    getHashCode() : string

### Returns

`string`Hash code

## Get Horizontal

    getHorizontal() : string

### Returns

`string`

## Get indent

    getIndent() : int

### Returns

`int`

## Is this a supervisor or a cell style component?

    getIsSupervisor() : boolean

Inherited

inherited_from | \PHPExcel_Style_Supervisor::getIsSupervisor()

### Returns

`boolean`

## Get the currently active cell coordinate in currently active sheet.

    getSelectedCells() : string

Inherited

Only used for supervisor

inherited_from | \PHPExcel_Style_Supervisor::getSelectedCells()

### Returns

`string`E.g. 'A1'

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

    getSharedComponent() : \PHPExcel_Style_Alignment

Only used for style supervisor

### Returns

`\PHPExcel_Style_Alignment`

## Get Shrink to fit

    getShrinkToFit() : boolean

### Returns

`boolean`

## Build style array from subcomponents

    getStyleArray(array $array) : array

### Parameters

#### $array

`array`

### Returns

`array`

## Get TextRotation

    getTextRotation() : int

### Returns

`int`

## Get Vertical

    getVertical() : string

### Returns

`string`

## Get Wrap Text

    getWrapText() : boolean

### Returns

`boolean`

## Set Horizontal

    setHorizontal(string $pValue) : \PHPExcel_Style_Alignment

### Parameters

#### $pValue

`string`

### Returns

`\PHPExcel_Style_Alignment`

## Set indent

    setIndent(int $pValue) : \PHPExcel_Style_Alignment

### Parameters

#### $pValue

`int`

### Returns

`\PHPExcel_Style_Alignment`

## Set Shrink to fit

    setShrinkToFit(boolean $pValue) : \PHPExcel_Style_Alignment

### Parameters

#### $pValue

`boolean`

### Returns

`\PHPExcel_Style_Alignment`

## Set TextRotation

    setTextRotation(int $pValue) : \PHPExcel_Style_Alignment

### Parameters

#### $pValue

`int`

### Exceptions

`\PHPExcel_Exception` |

### Returns

`\PHPExcel_Style_Alignment`

## Set Vertical

    setVertical(string $pValue) : \PHPExcel_Style_Alignment

### Parameters

#### $pValue

`string`

### Returns

`\PHPExcel_Style_Alignment`

## Set Wrap Text

    setWrapText(boolean $pValue) : \PHPExcel_Style_Alignment

### Parameters

#### $pValue

`boolean`

### Returns

`\PHPExcel_Style_Alignment`

### Properties

##

    $_horizontal : string

##

    $_indent : int

##

    $_isSupervisor : boolean

Inherited

inherited_from | \PHPExcel_Style_Supervisor::$$_isSupervisor

##

    $_parent : \PHPExcel_Style

Inherited

Only used for supervisor

inherited_from | \PHPExcel_Style_Supervisor::$$_parent

##

    $_shrinkToFit : boolean

##

    $_textRotation : int

##

    $_vertical : string

##

    $_wrapText : boolean

### Constants

## HORIZONTAL_CENTER

    HORIZONTAL_CENTER

## HORIZONTAL_CENTER_CONTINUOUS

    HORIZONTAL_CENTER_CONTINUOUS

## HORIZONTAL_GENERAL

    HORIZONTAL_GENERAL

## HORIZONTAL_JUSTIFY

    HORIZONTAL_JUSTIFY

## HORIZONTAL_LEFT

    HORIZONTAL_LEFT

## HORIZONTAL_RIGHT

    HORIZONTAL_RIGHT

## VERTICAL_BOTTOM

    VERTICAL_BOTTOM

## VERTICAL_CENTER

    VERTICAL_CENTER

## VERTICAL_JUSTIFY

    VERTICAL_JUSTIFY

## VERTICAL_TOP

    VERTICAL_TOP