Documentation

Cell extends Border
in package

Table cell style.

Table of Contents

Constants

DEFAULT_BORDER_COLOR  = '000000'
Default border color.
DEFAULT_MARGIN  = 1440
TEXT_DIR_BTLR  = 'btLr'
Bottom to Top, Left to Right.
TEXT_DIR_LRTB  = 'lrTb'
Left to Right, Top to Bottom.
TEXT_DIR_LRTBV  = 'lrTbV'
Left to Right, Top to Bottom Rotated.
TEXT_DIR_TBLRV  = 'tbLrV'
Top to Bottom, Left to Right Rotated.
TEXT_DIR_TBRL  = 'tbRl'
Top to Bottom, Right to Left.
TEXT_DIR_TBRLV  = 'tbRlV'
Top to Bottom, Right to Left Rotated.
VMERGE_CONTINUE  = 'continue'
VMERGE_RESTART  = 'restart'
Vertical merge (rowspan) constants.

Properties

$aliases  : array<string|int, mixed>
Aliases.
$borderBottomColor  : null|string
Border Bottom Color.
$borderBottomSize  : float|int
Border Bottom Size.
$borderBottomStyle  : string
Border Bottom Style.
$borderLeftColor  : null|string
Border Left Color.
$borderLeftSize  : float|int
Border Left Size.
$borderLeftStyle  : string
Border Left Style.
$borderRightColor  : null|string
Border Right Color.
$borderRightSize  : float|int
Border Right Size.
$borderRightStyle  : string
Border Right Style.
$borderTopColor  : null|string
Border Top Color.
$borderTopSize  : float|int
Border Top Size.
$borderTopStyle  : string
Border Top Style.
$index  : null|int
Index number in Style collection for named style.
$marginBottom  : float|int
Bottom margin spacing.
$marginLeft  : float|int
Left margin spacing.
$marginRight  : float|int
Right margin spacing.
$marginTop  : float|int
Top margin spacing.
$styleName  : string|null
Style name.
$gridSpan  : int
colspan.
$isAuto  : bool
Is this an automatic style? (Used primarily in OpenDocument driver).
$noWrap  : bool
Prevent text from wrapping in the cell.
$shading  : Shading
Shading.
$textDirection  : string
Text Direction.
$unit  : string
Width unit.
$vAlign  : null|string
Vertical align (top, center, both, bottom).
$vMerge  : null|string
rowspan (restart, continue).
$width  : int|null
Width.

Methods

getBgColor()  : string
Get background.
getBorderBottomColor()  : null|string
Get border bottom color.
getBorderBottomSize()  : float|int
Get border bottom size.
getBorderBottomStyle()  : string
Get border bottom style.
getBorderColor()  : array<string|int, null|string>
Get border color.
getBorderLeftColor()  : null|string
Get border left color.
getBorderLeftSize()  : float|int
Get border left size.
getBorderLeftStyle()  : string
Get border left style.
getBorderRightColor()  : null|string
Get border right color.
getBorderRightSize()  : float|int
Get border right size.
getBorderRightStyle()  : string
Get border right style.
getBorderSize()  : array<string|int, int>
Get border size.
getBorderStyle()  : array<string|int, string>
Get border style.
getBorderTopColor()  : null|string
Get border top color.
getBorderTopSize()  : float|int
Get border top size.
getBorderTopStyle()  : string
Get border top style.
getChildStyleValue()  : mixed
Return style value of child style object, e.g. `left` from `Indentation` child style of `Paragraph`.
getGridSpan()  : int
Get grid span (colspan).
getIndex()  : null|int
Get index number.
getMarginBottom()  : float|int
Get Margin Bottom.
getMarginLeft()  : float|int
Get Margin Left.
getMarginRight()  : float|int
Get Margin Right.
getMarginTop()  : float|int
Get Margin Top.
getNoWrap()  : bool
Get noWrap.
getShading()  : Shading
Get shading.
getStyleName()  : string|null
Get style name.
getTextDirection()  : string
Get text direction.
getUnit()  : string
Get width unit.
getVAlign()  : null|string
Get vertical align.
getVMerge()  : null|string
Get vertical merge (rowspan).
getWidth()  : int|null
Get cell width.
hasBorder()  : bool
Check if any of the border is not null.
isAuto()  : bool
Get is automatic style flag.
setAuto()  : self
Set is automatic style flag.
setBgColor()  : self
Set background.
setBorderBottomColor()  : self
Set border bottom color.
setBorderBottomSize()  : self
Set border bottom size.
setBorderBottomStyle()  : self
Set border bottom style.
setBorderColor()  : self
Set border color.
setBorderLeftColor()  : self
Set border left color.
setBorderLeftSize()  : self
Set border left size.
setBorderLeftStyle()  : self
Set border left style.
setBorderRightColor()  : self
Set border right color.
setBorderRightSize()  : self
Set border right size.
setBorderRightStyle()  : self
Set border right style.
setBorderSize()  : self
Set border size.
setBorderStyle()  : self
Set border style.
setBorderTopColor()  : self
Set border top color.
setBorderTopSize()  : self
Set border top size.
setBorderTopStyle()  : self
Set border top Style.
setGridSpan()  : self
Set grid span (colspan).
setIndex()  : self
Set index number.
setMarginBottom()  : self
Set Margin Bottom.
setMarginLeft()  : self
Set Margin Left.
setMarginRight()  : self
Set Margin Right.
setMarginTop()  : self
Set Margin Top.
setNoWrap()  : self
Set noWrap.
setShading()  : self
Set shading.
setStyleByArray()  : self
Set style by using associative array.
setStyleName()  : self
Set style name.
setStyleValue()  : self
Set style value template method.
setTextDirection()  : self
Set text direction.
setUnit()  : mixed
Set width unit.
setVAlign()  : self
Set vertical align.
setVMerge()  : self
Set vertical merge (rowspan).
setWidth()  : self
Set cell width.
setBoolVal()  : bool
Set bool value.
setEnumVal()  : mixed
Set enum value.
setFloatVal()  : null|float
Set float value: Convert string that contains only numeric into float.
setIntVal()  : null|int
Set integer value: Convert string that contains only numeric into integer.
setNonEmptyVal()  : string
Set default for null and empty value.
setNumericVal()  : null|float|int
Set numeric value.
setObjectVal()  : mixed
Set object value.
setPairedVal()  : self
Set $property value and set $pairProperty = false when $value = true.

Constants

DEFAULT_BORDER_COLOR

Default border color.

public mixed DEFAULT_BORDER_COLOR = '000000'
Tags
const

string

DEFAULT_MARGIN

public mixed DEFAULT_MARGIN = 1440

TEXT_DIR_BTLR

Bottom to Top, Left to Right.

public mixed TEXT_DIR_BTLR = 'btLr'

TEXT_DIR_LRTB

Left to Right, Top to Bottom.

public mixed TEXT_DIR_LRTB = 'lrTb'

TEXT_DIR_LRTBV

Left to Right, Top to Bottom Rotated.

public mixed TEXT_DIR_LRTBV = 'lrTbV'

TEXT_DIR_TBLRV

Top to Bottom, Left to Right Rotated.

public mixed TEXT_DIR_TBLRV = 'tbLrV'

TEXT_DIR_TBRL

Top to Bottom, Right to Left.

public mixed TEXT_DIR_TBRL = 'tbRl'

TEXT_DIR_TBRLV

Top to Bottom, Right to Left Rotated.

public mixed TEXT_DIR_TBRLV = 'tbRlV'

VMERGE_CONTINUE

public mixed VMERGE_CONTINUE = 'continue'

VMERGE_RESTART

Vertical merge (rowspan) constants.

public mixed VMERGE_RESTART = 'restart'
Tags
const

string

Properties

$aliases

Aliases.

protected array<string|int, mixed> $aliases = []

$borderBottomColor

Border Bottom Color.

protected null|string $borderBottomColor

$borderBottomSize

Border Bottom Size.

protected float|int $borderBottomSize

$borderBottomStyle

Border Bottom Style.

protected string $borderBottomStyle

$borderLeftColor

Border Left Color.

protected null|string $borderLeftColor

$borderLeftSize

Border Left Size.

protected float|int $borderLeftSize

$borderLeftStyle

Border Left Style.

protected string $borderLeftStyle

$borderRightColor

Border Right Color.

protected null|string $borderRightColor

$borderRightSize

Border Right Size.

protected float|int $borderRightSize

$borderRightStyle

Border Right Style.

protected string $borderRightStyle

$borderTopColor

Border Top Color.

protected null|string $borderTopColor

$borderTopSize

Border Top Size.

protected float|int $borderTopSize

$borderTopStyle

Border Top Style.

protected string $borderTopStyle

$index

Index number in Style collection for named style.

protected null|int $index

This number starts from one and defined in Style::setStyleValues()

$marginBottom

Bottom margin spacing.

protected float|int $marginBottom = self::DEFAULT_MARGIN

$marginLeft

Left margin spacing.

protected float|int $marginLeft = self::DEFAULT_MARGIN

$marginRight

Right margin spacing.

protected float|int $marginRight = self::DEFAULT_MARGIN

$marginTop

Top margin spacing.

protected float|int $marginTop = self::DEFAULT_MARGIN

$gridSpan

colspan.

private int $gridSpan

$isAuto

Is this an automatic style? (Used primarily in OpenDocument driver).

private bool $isAuto = false
Tags
since
0.11.0

$noWrap

Prevent text from wrapping in the cell.

private bool $noWrap = true

$textDirection

Text Direction.

private string $textDirection

$unit

Width unit.

private string $unit = \PhpOffice\PhpWord\SimpleType\TblWidth::TWIP

$vAlign

Vertical align (top, center, both, bottom).

private null|string $vAlign

$vMerge

rowspan (restart, continue).

private null|string $vMerge
  • restart: Start/restart merged region
  • continue: Continue merged region

$width

Width.

private int|null $width

Methods

getBgColor()

Get background.

public getBgColor() : string
Return values
string

getBorderBottomColor()

Get border bottom color.

public getBorderBottomColor() : null|string
Return values
null|string

getBorderBottomSize()

Get border bottom size.

public getBorderBottomSize() : float|int
Return values
float|int

getBorderBottomStyle()

Get border bottom style.

public getBorderBottomStyle() : string
Return values
string

getBorderColor()

Get border color.

public getBorderColor() : array<string|int, null|string>
Return values
array<string|int, null|string>

getBorderLeftColor()

Get border left color.

public getBorderLeftColor() : null|string
Return values
null|string

getBorderLeftSize()

Get border left size.

public getBorderLeftSize() : float|int
Return values
float|int

getBorderLeftStyle()

Get border left style.

public getBorderLeftStyle() : string
Return values
string

getBorderRightColor()

Get border right color.

public getBorderRightColor() : null|string
Return values
null|string

getBorderRightSize()

Get border right size.

public getBorderRightSize() : float|int
Return values
float|int

getBorderRightStyle()

Get border right style.

public getBorderRightStyle() : string
Return values
string

getBorderSize()

Get border size.

public getBorderSize() : array<string|int, int>
Return values
array<string|int, int>

getBorderStyle()

Get border style.

public getBorderStyle() : array<string|int, string>
Return values
array<string|int, string>

getBorderTopColor()

Get border top color.

public getBorderTopColor() : null|string
Return values
null|string

getBorderTopSize()

Get border top size.

public getBorderTopSize() : float|int
Return values
float|int

getBorderTopStyle()

Get border top style.

public getBorderTopStyle() : string
Return values
string

getChildStyleValue()

Return style value of child style object, e.g. `left` from `Indentation` child style of `Paragraph`.

public getChildStyleValue(AbstractStyle $substyleObject, string $substyleProperty) : mixed
Parameters
$substyleObject : AbstractStyle
$substyleProperty : string
Tags
since
0.12.0

getGridSpan()

Get grid span (colspan).

public getGridSpan() : int
Return values
int

getIndex()

Get index number.

public getIndex() : null|int
Return values
null|int

getMarginBottom()

Get Margin Bottom.

public getMarginBottom() : float|int
Return values
float|int

getMarginLeft()

Get Margin Left.

public getMarginLeft() : float|int
Return values
float|int

getMarginRight()

Get Margin Right.

public getMarginRight() : float|int
Return values
float|int

getMarginTop()

Get Margin Top.

public getMarginTop() : float|int
Return values
float|int

getNoWrap()

Get noWrap.

public getNoWrap() : bool
Return values
bool

getStyleName()

Get style name.

public getStyleName() : string|null
Return values
string|null

getTextDirection()

Get text direction.

public getTextDirection() : string
Return values
string

getUnit()

Get width unit.

public getUnit() : string
Return values
string

getVAlign()

Get vertical align.

public getVAlign() : null|string
Return values
null|string

getVMerge()

Get vertical merge (rowspan).

public getVMerge() : null|string
Return values
null|string

getWidth()

Get cell width.

public getWidth() : int|null
Return values
int|null

hasBorder()

Check if any of the border is not null.

public hasBorder() : bool
Return values
bool

isAuto()

Get is automatic style flag.

public isAuto() : bool
Return values
bool

setAuto()

Set is automatic style flag.

public setAuto([bool $value = true ]) : self
Parameters
$value : bool = true
Return values
self

setBgColor()

Set background.

public setBgColor([string $value = null ]) : self
Parameters
$value : string = null
Return values
self

setBorderBottomColor()

Set border bottom color.

public setBorderBottomColor([null|string $value = null ]) : self
Parameters
$value : null|string = null
Return values
self

setBorderBottomSize()

Set border bottom size.

public setBorderBottomSize([float|int $value = null ]) : self
Parameters
$value : float|int = null
Return values
self

setBorderBottomStyle()

Set border bottom style.

public setBorderBottomStyle([string $value = null ]) : self
Parameters
$value : string = null
Return values
self

setBorderColor()

Set border color.

public setBorderColor([null|string $value = null ]) : self
Parameters
$value : null|string = null
Return values
self

setBorderLeftColor()

Set border left color.

public setBorderLeftColor([null|string $value = null ]) : self
Parameters
$value : null|string = null
Return values
self

setBorderLeftSize()

Set border left size.

public setBorderLeftSize([float|int $value = null ]) : self
Parameters
$value : float|int = null
Return values
self

setBorderLeftStyle()

Set border left style.

public setBorderLeftStyle([string $value = null ]) : self
Parameters
$value : string = null
Return values
self

setBorderRightColor()

Set border right color.

public setBorderRightColor([null|string $value = null ]) : self
Parameters
$value : null|string = null
Return values
self

setBorderRightSize()

Set border right size.

public setBorderRightSize([float|int $value = null ]) : self
Parameters
$value : float|int = null
Return values
self

setBorderRightStyle()

Set border right style.

public setBorderRightStyle([string $value = null ]) : self
Parameters
$value : string = null
Return values
self

setBorderSize()

Set border size.

public setBorderSize([float|int $value = null ]) : self
Parameters
$value : float|int = null
Return values
self

setBorderStyle()

Set border style.

public setBorderStyle([string $value = null ]) : self
Parameters
$value : string = null
Return values
self

setBorderTopColor()

Set border top color.

public setBorderTopColor([null|string $value = null ]) : self
Parameters
$value : null|string = null
Return values
self

setBorderTopSize()

Set border top size.

public setBorderTopSize([float|int $value = null ]) : self
Parameters
$value : float|int = null
Return values
self

setBorderTopStyle()

Set border top Style.

public setBorderTopStyle([string $value = null ]) : self
Parameters
$value : string = null
Return values
self

setGridSpan()

Set grid span (colspan).

public setGridSpan([int $value = null ]) : self
Parameters
$value : int = null
Return values
self

setIndex()

Set index number.

public setIndex([null|int $value = null ]) : self
Parameters
$value : null|int = null
Return values
self

setMarginBottom()

Set Margin Bottom.

public setMarginBottom([float|int $value = null ]) : self
Parameters
$value : float|int = null
Return values
self

setMarginLeft()

Set Margin Left.

public setMarginLeft([float|int $value = null ]) : self
Parameters
$value : float|int = null
Return values
self

setMarginRight()

Set Margin Right.

public setMarginRight([float|int $value = null ]) : self
Parameters
$value : float|int = null
Return values
self

setMarginTop()

Set Margin Top.

public setMarginTop([float|int $value = null ]) : self
Parameters
$value : float|int = null
Return values
self

setNoWrap()

Set noWrap.

public setNoWrap(bool $value) : self
Parameters
$value : bool
Return values
self

setShading()

Set shading.

public setShading([mixed $value = null ]) : self
Parameters
$value : mixed = null
Return values
self

setStyleByArray()

Set style by using associative array.

public setStyleByArray([array<string|int, mixed> $values = [] ]) : self
Parameters
$values : array<string|int, mixed> = []
Return values
self

setStyleName()

Set style name.

public setStyleName(string $value) : self
Parameters
$value : string
Return values
self

setStyleValue()

Set style value template method.

public setStyleValue(string $key, array<string|int, mixed>|int|string $value) : self

Some child classes have their own specific overrides. Backward compability check for versions < 0.10.0 which use underscore prefix for their private properties. Check if the set method is exists. Throws an exception?

Parameters
$key : string
$value : array<string|int, mixed>|int|string
Return values
self

setTextDirection()

Set text direction.

public setTextDirection([string $value = null ]) : self
Parameters
$value : string = null
Return values
self

setUnit()

Set width unit.

public setUnit(string $value) : mixed
Parameters
$value : string

setVAlign()

Set vertical align.

public setVAlign([null|string $value = null ]) : self
Parameters
$value : null|string = null
Return values
self

setVMerge()

Set vertical merge (rowspan).

public setVMerge([null|string $value = null ]) : self
Parameters
$value : null|string = null
Return values
self

setWidth()

Set cell width.

public setWidth(int $value) : self
Parameters
$value : int
Return values
self

setBoolVal()

Set bool value.

protected setBoolVal(bool $value, bool $default) : bool
Parameters
$value : bool
$default : bool
Return values
bool

setEnumVal()

Set enum value.

protected setEnumVal([mixed $value = null ][, array<string|int, mixed> $enum = [] ][, mixed $default = null ]) : mixed
Parameters
$value : mixed = null
$enum : array<string|int, mixed> = []
$default : mixed = null

setFloatVal()

Set float value: Convert string that contains only numeric into float.

protected setFloatVal(mixed $value[, null|float $default = null ]) : null|float
Parameters
$value : mixed
$default : null|float = null
Return values
null|float

setIntVal()

Set integer value: Convert string that contains only numeric into integer.

protected setIntVal(null|float|int|string $value[, null|int $default = null ]) : null|int
Parameters
$value : null|float|int|string
$default : null|int = null
Return values
null|int

setNonEmptyVal()

Set default for null and empty value.

protected setNonEmptyVal(string|null $value, string $default) : string
Parameters
$value : string|null
$default : string
Return values
string

setNumericVal()

Set numeric value.

protected setNumericVal(mixed $value[, null|float|int $default = null ]) : null|float|int
Parameters
$value : mixed
$default : null|float|int = null
Return values
null|float|int

setObjectVal()

Set object value.

protected setObjectVal(mixed $value, string $styleName, mixed &$style) : mixed
Parameters
$value : mixed
$styleName : string
$style : mixed

setPairedVal()

Set $property value and set $pairProperty = false when $value = true.

protected setPairedVal(bool &$property, bool &$pairProperty, bool $value) : self
Parameters
$property : bool
$pairProperty : bool
$value : bool
Return values
self

        
On this page

Search results