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.
- `` borderBottomSize `` . Border bottom size (in twips).
- `` borderLeftColor `` . Border left color.
- `` borderLeftSize `` . Border left size (in twips).
- `` borderRightColor `` . Border right color.
- `` borderRightSize `` . Border right size (in twips).
- `` borderTopColor `` . Border top color.
- `` borderTopSize `` . Border top size (in twips).
- `` 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.
- `` marginTop `` . Page margin top (in twips).
- `` marginLeft `` . Page margin left (in twips).
- `` marginRight `` . Page margin right (in twips).
- `` marginBottom `` . Page margin bottom (in twips).
- `` orientation `` . Page orientation (`` portrait `` , which is default, or `` landscape `` ).
- `` pageSizeH `` . Page height (in twips). Implicitly defined by `` orientation `` option. Any changes are discouraged.
- `` pageSizeW `` . Page width (in twips). Implicitly defined by `` orientation `` option. Any changes are discouraged.
.. _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.
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.
- `` hanging `` . Hanging by how much.
- `` indent `` . Indent by how much.
- `` 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* .
- `` spaceBefore `` . Space before paragraph.
- `` spaceAfter `` . Space after paragraph.
- `` 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'.
- `` border(Top|Right|Bottom|Left)Size `` . Border size in twips.
- `` cellMargin(Top|Right|Bottom|Left) `` . Cell margin in twips.
- `` width `` . Table width in percent.
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'.
- `` border(Top|Right|Bottom|Left)Size `` . Border size in twips.
- `` 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* .
- `` width `` . Cell width in twips.
.. _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.
2015-10-10 19:06:23 +04:00
- `` height `` . Height in pixels.
- `` marginLeft `` . Left margin in inches, can be negative.
- `` marginTop `` . Top margin in inches, can be negative.
- `` width `` . Width in pixels.
- `` wrappingStyle `` . Wrapping style, *inline* , *square* , *tight* , *behind* , or *infront* .
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.