2014-06-08 17:10:02 +07:00
.. _styles:
Styles
======
2015-10-10 19:06:23 +04:00
.. _section-style:
2014-06-08 17:10:02 +07:00
Section
-------
2015-10-10 19:06:23 +04:00
Available Section style options:
- `` borderBottomColor `` . Border bottom color.
2018-02-16 14:40:31 +01:00
- `` borderBottomSize `` . Border bottom size in *twip* .
2015-10-10 19:06:23 +04:00
- `` borderLeftColor `` . Border left color.
2018-02-16 14:40:31 +01:00
- `` borderLeftSize `` . Border left size in *twip* .
2015-10-10 19:06:23 +04:00
- `` borderRightColor `` . Border right color.
2018-02-16 14:40:31 +01:00
- `` borderRightSize `` . Border right size in *twip* .
2015-10-10 19:06:23 +04:00
- `` borderTopColor `` . Border top color.
2018-02-16 14:40:31 +01:00
- `` borderTopSize `` . Border top size in *twip* .
2015-10-10 19:06:23 +04:00
- `` breakType `` . Section break type (nextPage, nextColumn, continuous, evenPage, oddPage).
- `` colsNum `` . Number of columns.
- `` colsSpace `` . Spacing between columns.
- `` footerHeight `` . Spacing to bottom of footer.
- `` gutter `` . Page gutter spacing.
- `` headerHeight `` . Spacing to top of header.
2018-02-16 14:40:31 +01:00
- `` marginTop `` . Page margin top in *twip* .
- `` marginLeft `` . Page margin left in *twip* .
- `` marginRight `` . Page margin right in *twip* .
- `` marginBottom `` . Page margin bottom in *twip* .
2015-10-10 19:06:23 +04:00
- `` orientation `` . Page orientation (`` portrait `` , which is default, or `` landscape `` ).
2018-02-16 14:40:31 +01:00
- `` pageSizeH `` . Page height in *twip* . Implicitly defined by `` orientation `` option. Any changes are discouraged.
- `` pageSizeW `` . Page width in *twip* . Implicitly defined by `` orientation `` option. Any changes are discouraged.
2015-10-10 19:06:23 +04:00
.. _font-style:
2014-06-08 17:10:02 +07:00
Font
----
2015-10-10 19:06:23 +04:00
Available Font style options:
- `` allCaps `` . All caps, *true* or *false* .
- `` bgColor `` . Font background color, e.g. *FF0000* .
- `` bold `` . Bold, *true* or *false* .
- `` color `` . Font color, e.g. *FF0000* .
- `` doubleStrikethrough `` . Double strikethrough, *true* or *false* .
- `` fgColor `` . Font highlight color, e.g. *yellow* , *green* , *blue* .
2017-11-08 00:27:58 +01:00
See `` \PhpOffice\PhpWord\Style\Font::FGCOLOR_... `` constants for more values
2015-10-10 19:06:23 +04:00
- `` hint `` . Font content type, *default* , *eastAsia* , or *cs* .
- `` italic `` . Italic, *true* or *false* .
- `` name `` . Font name, e.g. *Arial* .
- `` rtl `` . Right to Left language, *true* or *false* .
- `` size `` . Font size, e.g. *20* , *22* .
- `` smallCaps `` . Small caps, *true* or *false* .
- `` strikethrough `` . Strikethrough, *true* or *false* .
- `` subScript `` . Subscript, *true* or *false* .
- `` superScript `` . Superscript, *true* or *false* .
2017-11-08 00:27:58 +01:00
- `` underline `` . Underline, *single* , *dash* , *dotted* , etc.
See `` \PhpOffice\PhpWord\Style\Font::UNDERLINE_... `` constants for more values
2017-09-27 00:40:08 +02:00
- `` lang `` . Language, either a language code like *en-US* , *fr-BE* , etc. or an object (or as an array) if you need to set eastAsian or bidirectional languages
See `` \PhpOffice\PhpWord\Style\Language `` class for some language codes.
2018-03-06 06:35:43 +01:00
- `` position `` . The text position, raised or lowered, in half points
2015-10-10 19:06:23 +04:00
.. _paragraph-style:
2014-06-08 17:10:02 +07:00
Paragraph
---------
2015-10-10 19:06:23 +04:00
Available Paragraph style options:
2016-02-23 19:02:35 +04:00
- `` alignment `` . Supports all alignment modes since 1st Edition of ECMA-376 standard up till ISO/IEC 29500:2012.
2017-09-27 00:40:08 +02:00
See `` \PhpOffice\PhpWord\SimpleType\Jc `` class for the details.
2015-10-10 19:06:23 +04:00
- `` basedOn `` . Parent style.
2018-02-16 15:45:20 +01:00
- `` hanging `` . Hanging in *twip* .
- `` indent `` . Indent in *twip* .
2015-10-10 19:06:23 +04:00
- `` keepLines `` . Keep all lines on one page, *true* or *false* .
- `` keepNext `` . Keep paragraph with next paragraph, *true* or *false* .
- `` lineHeight `` . Text line height, e.g. *1.0* , *1.5* , etc.
- `` next `` . Style for next paragraph.
- `` pageBreakBefore `` . Start paragraph on next page, *true* or *false* .
2018-02-16 15:45:20 +01:00
- `` spaceBefore `` . Space before paragraph in *twip* .
- `` spaceAfter `` . Space after paragraph in *twip* .
2017-11-22 00:14:31 +01:00
- `` spacing `` . Space between lines.
- `` spacingLineRule `` . Line Spacing Rule. *auto* , *exact* , *atLeast*
2018-03-06 22:19:40 +01:00
- `` suppressAutoHyphens `` . Hyphenation for paragraph, *true* or *false* .
2015-10-10 19:06:23 +04:00
- `` tabs `` . Set of custom tab stops.
- `` widowControl `` . Allow first/last line to display on a separate page, *true* or *false* .
2017-07-01 22:51:53 +02:00
- `` contextualSpacing `` . Ignore Spacing Above and Below When Using Identical Styles, *true* or *false* .
2017-11-05 22:48:04 +01:00
- `` bidi `` . Right to Left Paragraph Layout, *true* or *false* .
- `` shading `` . Paragraph Shading.
- `` textAlignment `` . Vertical Character Alignment on Line.
See `` \PhpOffice\PhpWord\SimpleType\TextAlignment `` class for possible values.
2015-10-10 19:06:23 +04:00
.. _table-style:
2014-06-08 17:10:02 +07:00
Table
-----
2015-10-10 19:06:23 +04:00
Available Table style options:
2014-06-08 17:10:02 +07:00
2016-02-23 19:02:35 +04:00
- `` alignment `` . Supports all alignment modes since 1st Edition of ECMA-376 standard up till ISO/IEC 29500:2012.
2017-09-27 00:40:08 +02:00
See `` \PhpOffice\PhpWord\SimpleType\JcTable `` and `` \PhpOffice\PhpWord\SimpleType\Jc `` classes for the details.
2015-10-10 19:06:23 +04:00
- `` bgColor `` . Background color, e.g. '9966CC'.
- `` border(Top|Right|Bottom|Left)Color `` . Border color, e.g. '9966CC'.
2018-02-16 14:40:31 +01:00
- `` border(Top|Right|Bottom|Left)Size `` . Border size in *twip* .
- `` cellMargin(Top|Right|Bottom|Left) `` . Cell margin in *twip* .
2018-04-11 09:56:02 +02:00
- `` indent `` . Table indent from leading margin. Must be an instance of `` \PhpOffice\PhpWord\ComplexType\TblWidth `` .
2015-10-10 19:06:23 +04:00
- `` width `` . Table width in percent.
2018-02-18 02:10:10 +03:00
- `` unit `` . The unit to use for the width. One of `` \PhpOffice\PhpWord\SimpleType\TblWidth `` . Defaults to *auto* .
2018-02-14 00:39:37 +01:00
- `` layout `` . Table layout, either *fixed* or *autofit* See `` \PhpOffice\PhpWord\Style\Table `` for constants.
2018-02-18 02:10:10 +03:00
- `` cellSpacing `` Cell spacing in *twip*
2018-03-08 23:46:22 +01:00
- `` position `` Floating Table Positioning, see below for options
Floating Table Positioning options:
- `` leftFromText `` Distance From Left of Table to Text in *twip*
- `` rightFromText `` Distance From Right of Table to Text in *twip*
- `` topFromText `` Distance From Top of Table to Text in *twip*
- `` bottomFromText `` Distance From Top of Table to Text in *twip*
- `` vertAnchor `` Table Vertical Anchor, one of `` \PhpOffice\PhpWord\Style\TablePosition::VANCHOR_* ``
- `` horzAnchor `` Table Horizontal Anchor, one of `` \PhpOffice\PhpWord\Style\TablePosition::HANCHOR_* ``
- `` tblpXSpec `` Relative Horizontal Alignment From Anchor, one of `` \PhpOffice\PhpWord\Style\TablePosition::XALIGN_* ``
- `` tblpX `` Absolute Horizontal Distance From Anchorin *twip*
- `` tblpYSpec `` Relative Vertical Alignment From Anchor, one of `` \PhpOffice\PhpWord\Style\TablePosition::YALIGN_* ``
- `` tblpY `` Absolute Vertical Distance From Anchorin *twip*
2014-06-08 17:10:02 +07:00
2015-10-10 19:06:23 +04:00
Available Row style options:
2014-06-08 17:10:02 +07:00
2015-10-10 19:06:23 +04:00
- `` cantSplit `` . Table row cannot break across pages, *true* or *false* .
- `` exactHeight `` . Row height is exact or at least.
- `` tblHeader `` . Repeat table row on every new page, *true* or *false* .
2014-06-08 17:10:02 +07:00
2015-10-10 19:06:23 +04:00
Available Cell style options:
2014-06-08 17:10:02 +07:00
2015-10-10 19:06:23 +04:00
- `` bgColor `` . Background color, e.g. '9966CC'.
- `` border(Top|Right|Bottom|Left)Color `` . Border color, e.g. '9966CC'.
2018-02-16 14:40:31 +01:00
- `` border(Top|Right|Bottom|Left)Size `` . Border size in *twip* .
2015-10-10 19:06:23 +04:00
- `` gridSpan `` . Number of columns spanned.
2017-09-27 00:40:08 +02:00
- `` textDirection(btLr|tbRl) `` . Direction of text.
You can use constants `` \PhpOffice\PhpWord\Style\Cell::TEXT_DIR_BTLR `` and `` \PhpOffice\PhpWord\Style\Cell::TEXT_DIR_TBRL ``
2015-10-10 19:06:23 +04:00
- `` valign `` . Vertical alignment, *top* , *center* , *both* , *bottom* .
- `` vMerge `` . *restart* or *continue* .
2018-02-16 14:40:31 +01:00
- `` width `` . Cell width in *twip* .
2015-10-10 19:06:23 +04:00
.. _image-style:
2014-06-08 17:10:02 +07:00
Image
-----
2015-10-10 19:06:23 +04:00
Available Image style options:
2015-10-10 19:22:19 +04:00
- `` alignment `` . See `` \PhpOffice\PhpWord\SimpleType\Jc `` class for the details.
2018-04-10 11:18:37 +02:00
- `` height `` . Height in *pt* .
2015-10-10 19:06:23 +04:00
- `` marginLeft `` . Left margin in inches, can be negative.
- `` marginTop `` . Top margin in inches, can be negative.
2018-04-10 11:18:37 +02:00
- `` width `` . Width in *pt* .
2015-10-10 19:06:23 +04:00
- `` wrappingStyle `` . Wrapping style, *inline* , *square* , *tight* , *behind* , or *infront* .
2018-03-11 15:02:24 +01:00
- `` wrapDistanceTop `` . Top text wrapping in pixels.
- `` wrapDistanceBottom `` . Bottom text wrapping in pixels.
- `` wrapDistanceLeft `` . Left text wrapping in pixels.
- `` wrapDistanceRight `` . Right text wrapping in pixels.
2014-06-08 17:10:02 +07:00
2015-10-10 19:06:23 +04:00
.. _numbering-level-style:
2014-06-08 17:10:02 +07:00
Numbering level
---------------
2015-10-10 19:06:23 +04:00
Available NumberingLevel style options:
2016-02-23 19:02:35 +04:00
- `` alignment `` . Supports all alignment modes since 1st Edition of ECMA-376 standard up till ISO/IEC 29500:2012.
2017-09-27 00:40:08 +02:00
See `` \PhpOffice\PhpWord\SimpleType\Jc `` class for the details.
2015-10-10 19:06:23 +04:00
- `` font `` . Font name.
- `` format `` . Numbering format bullet\|decimal\|upperRoman\|lowerRoman\|upperLetter\|lowerLetter.
- `` hanging `` . See paragraph style.
- `` hint `` . See font style.
- `` left `` . See paragraph style.
- `` restart `` . Restart numbering level symbol.
- `` start `` . Starting value.
- `` suffix `` . Content between numbering symbol and paragraph text tab\|space\|nothing.
- `` tabPos `` . See paragraph style.
2016-05-24 08:57:24 +03:00
- `` text `` . Numbering level text e.g. %1 for nonbullet or bullet character.
2018-03-21 22:19:56 +01:00
.. _chart-style:
Chart
-----
Available Chart style options:
- `` width `` . Width (in EMU).
- `` height `` . Height (in EMU).
- `` 3d `` . Is 3D; applies to pie, bar, line, area, *true* or *false* .
- `` showAxisLabels `` . Show labels for axis, *true* or *false* .
- `` gridX `` . Show Gridlines for X-Axis, *true* or *false* .
- `` gridY `` . Show Gridlines for Y-Axis, *true* or *false* .