createTableStyle

createTableStyle

BASIC / ADVANCED / PREMIUM

Creates a table style in the PowerPoint presentation.

Description
public createTableStyle ($name, array $styles)

This method creates a table style in the PowerPoint presentation.

PowerPoint has limitations when creating table styles, as only a few styles are available. Additional styles can be applied to the table contents using phppptx methods.

Parameters

name

Table style name.

styles

Key Type Description
backgroundColor string HEX color.
bold bool
border array

Available positions:

  • top
  • right
  • bottom
  • left
  • insideH
  • insideV

Available styles:

  • 'dash' (string) solid, dot, dash, lgDash, dashDot, lgDashDot, lgDashDotDot, sysDash, sysDot, sysDashDot, sysDashDotDot
  • 'color' (string) default as 000000. none to avoid adding the color
  • 'width' (int) EMUs (English Metric Unit). Default as 12700 (1pt)
italic bool

Available types:

  • wholeTbl : whole table
  • band1H : band 1 horizontal
  • band2H : band 2 horizontal
  • band1V : band 1 vertical
  • band2V : band 2 vertical
  • lastCol : last column
  • firstCol : first column
  • lastRow : last row
  • firstRow : first row
  • neCell : northeast cell
  • seCell : southeast cell
  • swCell : southwest cell
  • nwCell : northwest cell
Exceptions

Duplicated table style name.

Code samples

Example #1

The resulting PPTX looks like:

Release notes
  • phppptx 4.0:
    • new method.