PowerPoint Generator API
  • PowerPoint Generator API
  • Getting started
    • Quick start
  • API reference
    • token/create
    • generator/create
  • Knowledge base
    • Key concepts
    • Templating your presentation
    • Building your JSON payload
    • Finding shape names
  • JSON/ PPTX Reference
    • presentation
    • slides
    • shapes
      • textbox
      • chart
      • picture
      • table
    • tags
    • Deprecated
  • Examples
    • Presentation
      • Naming output presentation
      • Using multiple templates
    • Slide
      • Change shape size and position
      • Change shape background color
      • Hide or remove shape
      • Replacing tags
    • Textboxes
      • Add text
      • Set font type and size
      • Set font color and font background color
      • Set bold, italic & underline
      • Set text alignment
      • Set text indentation
      • Set text line spacing
      • Using bullet-points
    • Chart
      • Change font settings
      • Insert data
      • Adjust chart legend
      • Appending to data labels
    • Pictures
    • Table
      • Populate simple table
      • Using `text_runs` in Table cells
      • Handling merged cells
      • Update a specific cells in existing table
    • Tags
Powered by GitBook
On this page

Was this helpful?

  1. Examples
  2. Table

Handling merged cells

You can add data to tables even if there are merged cells.

PreviousUsing `text_runs` in Table cellsNextUpdate a specific cells in existing table

Last updated 10 months ago

Was this helpful?

Using the following payload you can add data to all cells, including the merged cells.

Each list in `data_cells` denotes a row in your table.

Each row list must have the same number of list objects. Data from the last merged cell will be rendered to the merged cell in your table shape.

Limitation - currently, if your table shape has a merged cell, your payload must have the same number of data points otherwise it will fail. This will be improved very soon.

Before vs after

Template Presentation

JSON Payload

{
  "presentation": {
    "template": "table_with_merged_cells.pptx",
    "export_version": "Pptx2010",
    "slides": [
      {
        "type": "slide",
        "slide_index": 2,
        "shapes": [
          {
            "type": "table",
            "name": "Table 2",
            "data_cells": [
              [
                "A1",
                "A2",
                "A3",
                "A4",
                "A5",
                "A6"
              ],
              [
                "",
                "",
                "B1:B3",
                "B4",
                "B5",
                "B6"
              ],
              [
                "C1",
                "C2",
                "C3",
                "C4",
                "C5",
                "C6"
              ],
              [
                "D1",
                "D2",
                "D3",
                "D4",
                "D5",
                "D6"
              ]
            ]
          }
        ]
      }
    ]
  }
}
808KB
slides_as_template_merged_table.pptx