# Handling merged cells

Using the following payload you can add data to all cells, including the merged cells.&#x20;

1. Select the shape by `name` you want to modify. See [here](/knowledge-base/finding-shape-names.md) to find shape names.
2. Each list in \`data\_cells\` denotes a row in your table.&#x20;
3. 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.

{% hint style="info" %}
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.&#x20;
{% endhint %}

Reference: [table](/json-template-syntax/shapes/table.md)

Download: [input.zip](https://drive.google.com/uc?export=download\&id=1mzqgQh2n_HOdh1SiVYvnoY99C-MOW5M4) | [output.pptx](https://drive.google.com/uc?export=download\&id=1glVhMuea6R4df3-OJM4ouOAcJTayg5_L)

{% columns %}
{% column width="41.66666666666667%" %}

<figure><img src="/files/oLfOEI8ZXjswHO6ZYjl4" alt=""><figcaption></figcaption></figure>

***

<figure><img src="/files/r1Lm19wEAiUMnOgCaN81" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column width="58.33333333333333%" %}
{% code lineNumbers="true" %}

```json
{
  "presentation": {
    "template": "template.pptx",
    "slides": [
      {
        "slide_index": 0,
        "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"
              ]
            ]
          }
        ]
      }
    ]
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.powerpointgeneratorapi.com/examples/table/handling-merged-cells.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
