JSON API - addTable

addTable

PREMIUM TRIAL / ADVANCED

Adds tables into the PowerPoint presentation.

Note

You are reading the JSON API documentation. For the PHP API method please go to addTable.

JSON data
Key Description
contents Array of cell contents and styles. PptxFragments can be used to add contents
text See addText for text styles.
align left, center, right, justify
backgroundColor HEX color
border
  • "dash" solid, dot, dash, lgDash, dashDot, lgDashDot, lgDashDotDot, sysDash, sysDot, sysDashDot, sysDashDotDot.
  • "color" default as 000000. none to avoid adding the color.
  • "width" EMUs (English Metric Unit). Default as 12700 (1pt).
cellMargin
  • "top"
  • "right"
  • "bottom"
  • "left"
colspan HEX color.
image Image path, Base64, or URL.
rowspan
textDirection horz, vert, vert270, wordArtVert, eaVert, mongolianVert, wordArtVertRtl.
verticalAlign top, middle, bottom, topCentered, middleCentered, bottomCentered.
wrap square, none.
coordinateX EMUs (English Metric Unit).
coordinateY EMUs (English Metric Unit).
sizeX EMUs (English Metric Unit).
sizeY EMUs (English Metric Unit).
name Internal name. If not set, a random name is generated.
order Set the display order. Default after existing contents. 0 is the first order position. If the order position doesn't exist add after existing contents.
backgroundColor HEX color.
bandedColumns Banded columns. Default as false.
bandedRows Banded rows. Default as false.
border
  • "dash" solid, dot, dash, lgDash, dashDot, lgDashDot, lgDashDotDot, sysDash, sysDot, sysDashDot, sysDashDotDot.
  • "color" default as 000000. none to avoid adding the color.
  • "width" EMUs (English Metric Unit). Default as 12700 (1pt).
cellMargin
  • "top"
  • "right"
  • "bottom"
  • "left"
columnWidths Column width fix (number) or column width variable (array). If not set, get from the shape size. EMUs (English Metric Unit).
descr Placeholder alt text (descr) value.
firstColumn First column. Default as false.
headerRow Header row. Default as false.
lastColumn Last column. Default as false.
rtl RTL. Default as false.
style Table style name. Using a template, if the table doesn't exist, try to import it from the default base template.

Table styles available in the default base template:

  • Dark Style 1
  • Dark Style 1 - Accent 1
  • Dark Style 1 - Accent 2
  • Dark Style 1 - Accent 3
  • Dark Style 1 - Accent 4
  • Dark Style 1 - Accent 5
  • Dark Style 1 - Accent 6
  • Dark Style 2
  • Dark Style 2 - Accent 1/Accent 2
  • Dark Style 2 - Accent 3/Accent 4
  • Dark Style 2 - Accent 5/Accent 6
  • Light Style 1
  • Light Style 1 - Accent 1
  • Light Style 1 - Accent 2
  • Light Style 1 - Accent 3
  • Light Style 1 - Accent 4
  • Light Style 1 - Accent 5
  • Light Style 1 - Accent 6
  • Light Style 2
  • Light Style 2 - Accent 1
  • Light Style 2 - Accent 2
  • Light Style 2 - Accent 3
  • Light Style 2 - Accent 4
  • Light Style 2 - Accent 5
  • Light Style 2 - Accent 6
  • Light Style 3
  • Light Style 3 - Accent 1
  • Light Style 3 - Accent 2
  • Light Style 3 - Accent 3
  • Light Style 3 - Accent 4
  • Light Style 3 - Accent 5
  • Light Style 3 - Accent 6
  • Medium Style 1
  • Medium Style 1 - Accent 1
  • Medium Style 1 - Accent 2
  • Medium Style 1 - Accent 3
  • Medium Style 1 - Accent 4
  • Medium Style 1 - Accent 5
  • Medium Style 1 - Accent 6
  • Medium Style 2
  • Medium Style 2 - Accent 1
  • Medium Style 2 - Accent 2
  • Medium Style 2 - Accent 3
  • Medium Style 2 - Accent 4
  • Medium Style 2 - Accent 5
  • Medium Style 2 - Accent 6
  • Medium Style 3
  • Medium Style 3 - Accent 1
  • Medium Style 3 - Accent 2
  • Medium Style 3 - Accent 3
  • Medium Style 3 - Accent 4
  • Medium Style 3 - Accent 5
  • Medium Style 3 - Accent 6
  • Medium Style 4
  • Medium Style 4 - Accent 1
  • Medium Style 4 - Accent 2
  • Medium Style 4 - Accent 3
  • Medium Style 4 - Accent 4
  • Medium Style 4 - Accent 5
  • Medium Style 4 - Accent 6
  • No Style, No Grid
  • No Style, Table Grid
  • Themed Style 1 - Accent 1
  • Themed Style 1 - Accent 2
  • Themed Style 1 - Accent 3
  • Themed Style 1 - Accent 4
  • Themed Style 1 - Accent 5
  • Themed Style 1 - Accent 6
  • Themed Style 2 - Accent 1
  • Themed Style 2 - Accent 2
  • Themed Style 2 - Accent 3
  • Themed Style 2 - Accent 4
  • Themed Style 2 - Accent 5
  • Themed Style 2 - Accent 6
totalRow Total row. Default as false.
height EMUs (English Metric Unit).
Code samples

Example #1

Example #2

Release notes
  • phppptx 5.0:
    • new action.