# Merged table cells in Confluence storage format

URL: https://goingstellar.ro/reference/confluence-storage-format/merged-cells/

Merged cells use the standard rowspan and colspan attributes on td or th. The storage format page documents rowspan with a two-row example. In ADF every cell carries both span values, and the converter writes only the ones that differ from 1.

## Storage format

```xml
<td rowspan="2">Merged Cell</td>
<td colspan="2">Wide cell</td>
```

## As ADF (Confluence Cloud)

The ADF that Confluence Cloud builds for:

```xml
<table><tbody><tr><th>Table Heading Cell 1</th><th>Table Heading Cell 2</th></tr><tr><td rowspan="2">Merged Cell</td><td>Normal Cell 1</td></tr><tr><td colspan="1">Normal Cell 2</td></tr></tbody></table>
```

```json
{
 "type": "doc",
 "content": [
  {
   "type": "table",
   "attrs": {
    "__autoSize": true
   },
   "content": [
    {
     "type": "tableRow",
     "content": [
      {
       "type": "tableHeader",
       "attrs": {
        "colspan": 1,
        "rowspan": 1
       },
       "content": [
        {
         "type": "paragraph",
         "content": [
          {
           "text": "Table Heading Cell 1",
           "type": "text"
          }
         ]
        }
       ]
      },
      {
       "type": "tableHeader",
       "attrs": {
        "colspan": 1,
        "rowspan": 1
       },
       "content": [
        {
         "type": "paragraph",
         "content": [
          {
           "text": "Table Heading Cell 2",
           "type": "text"
          }
         ]
        }
       ]
      }
     ]
    },
    {
     "type": "tableRow",
     "content": [
      {
       "type": "tableCell",
       "attrs": {
        "colspan": 1,
        "rowspan": 2
       },
       "content": [
        {
         "type": "paragraph",
         "content": [
          {
           "text": "Merged Cell",
           "type": "text"
          }
         ]
        }
       ]
      },
      {
       "type": "tableCell",
       "attrs": {
        "colspan": 1,
        "rowspan": 1
       },
       "content": [
        {
         "type": "paragraph",
         "content": [
          {
           "text": "Normal Cell 1",
           "type": "text"
          }
         ]
        }
       ]
      }
     ]
    },
    {
     "type": "tableRow",
     "content": [
      {
       "type": "tableCell",
       "attrs": {
        "colspan": 1,
        "rowspan": 1
       },
       "content": [
        {
         "type": "paragraph",
         "content": [
          {
           "text": "Normal Cell 2",
           "type": "text"
          }
         ]
        }
       ]
      }
     ]
    }
   ]
  }
 ],
 "version": 1
}
```

## Examples

Storage format sent:

```xml
<table><tbody><tr><th>Table Heading Cell 1</th><th>Table Heading Cell 2</th></tr><tr><td rowspan="2">Merged Cell</td><td>Normal Cell 1</td></tr><tr><td colspan="1">Normal Cell 2</td></tr></tbody></table>
```

The merged-cell example from the storage format page: one cell spanning two rows, plus a cell that states colspan="1" explicitly.

Rendered view (HTML):

```html
<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th class="confluenceTh">Table Heading Cell 1</th><th class="confluenceTh">Table Heading Cell 2</th></tr><tr><td rowspan="2" class="confluenceTd">Merged Cell</td><td class="confluenceTd">Normal Cell 1</td></tr><tr><td colspan="1" class="confluenceTd">Normal Cell 2</td></tr></tbody></table></div>
```

Storage format after the round trip through ADF:

```xml
<table data-layout="default"><tbody><tr><th><p>Table Heading Cell 1</p></th><th><p>Table Heading Cell 2</p></th></tr><tr><td rowspan="2"><p>Merged Cell</p></td><td><p>Normal Cell 1</p></td></tr><tr><td><p>Normal Cell 2</p></td></tr></tbody></table>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
ADF:{"content": [{"attrs": {"isNumberColumnEnabled": true, "layout": "wide"}, "content": [{"content": [{"content": [{"content": [{"text": "H1", "type": "text"}], "type": "paragraph"}], "type": "tableHeader"}, {"content": [{"content": [{"text": "H2", "type": "text"}], "type": "paragraph"}], "type": "tableHeader"}], "type": "tableRow"}, {"content": [{"attrs": {"colspan": 2}, "content": [{"content": [{"text": "merged", "type": "text"}], "type": "paragraph"}], "type": "tableCell"}], "type": "tableRow"}, {"content": [{"attrs": {"background": "#deebff"}, "content": [{"content": [{"text": "bg", "type": "text"}], "type": "paragraph"}], "type": "tableCell"}, {"content": [{"content": [{"text": "x", "type": "text"}], "type": "paragraph"}], "type": "tableCell"}], "type": "tableRow"}], "type": "table"}], "type": "doc", "version": 1}
```

A cell that spans two columns, created from ADF with colspan 2. Shows what Confluence writes when the editor, not a person, produces the span.

Rendered view (HTML):

```html
<div class="table-wrap"><table data-layout="wide" class="confluenceTable"><colgroup><col/></colgroup><tbody><tr><th class="numberingColumn confluenceTh" /><th class="confluenceTh"><p>H1</p></th><th class="confluenceTh"><p>H2</p></th></tr><tr><td class="numberingColumn confluenceTd">1</td><td colspan="2" class="confluenceTd"><p>merged</p></td></tr><tr><td class="numberingColumn confluenceTd">2</td><td data-highlight-colour="#deebff" class="confluenceTd"><p>bg</p></td><td class="confluenceTd"><p>x</p></td></tr></tbody></table></div>
```

Storage format after the round trip through ADF:

```xml
<table data-layout="wide"><colgroup><col /></colgroup><tbody><tr><th class="numberingColumn" /><th><p>H1</p></th><th><p>H2</p></th></tr><tr><td class="numberingColumn">1</td><td colspan="2"><p>merged</p></td></tr><tr><td class="numberingColumn">2</td><td data-highlight-colour="#deebff"><p>bg</p></td><td><p>x</p></td></tr></tbody></table>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
<table><tbody><tr><th>Table Heading Cell 1</th><th>Table Heading Cell 2</th></tr><tr><td>Normal Cell 1</td><td>Normal Cell 2</td></tr></tbody></table>
```

A table with no spans at all. After conversion no rowspan or colspan attribute appears, although every ADF cell carries both values.

Rendered view (HTML):

```html
<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th class="confluenceTh">Table Heading Cell 1</th><th class="confluenceTh">Table Heading Cell 2</th></tr><tr><td class="confluenceTd">Normal Cell 1</td><td class="confluenceTd">Normal Cell 2</td></tr></tbody></table></div>
```

Storage format after the round trip through ADF:

```xml
<table data-layout="default"><tbody><tr><th><p>Table Heading Cell 1</p></th><th><p>Table Heading Cell 2</p></th></tr><tr><td><p>Normal Cell 1</p></td><td><p>Normal Cell 2</p></td></tr></tbody></table>
```

Sent to Confluence Cloud on 29 Nov 2026.

## What changes in conversion

- rowspan="2" is kept in both directions and the rendered table spans two rows.
- An explicit colspan="1" is accepted in storage and rendered, but it is gone after the ADF round trip, because the default value is not written back.
- colspan="2" written as storage was saved and read back unchanged, and a span created from ADF comes back as colspan="2" on the td.
- ADF stores colspan and rowspan on every tableCell and tableHeader as numbers, and the converter writes a span to storage only when it is larger than 1.

## Pitfalls

- Do not count on colspan="1" or rowspan="1" staying in the stored text. They are removed when the editor saves.
- A span created from ADF has to be read back from storage, not from the ADF you sent: the storage text only carries spans larger than 1.
- The runs only merged td cells. A span on a header cell in ADF carries the same two numbers, but no storage run covers it.

## Related

- [Tables](https://goingstellar.ro/reference/confluence-storage-format/tables/)
- [Cell background colours](https://goingstellar.ro/reference/confluence-storage-format/table-cell-colours/)
- [Table width, layout and numbered rows](https://goingstellar.ro/reference/confluence-storage-format/table-width-layout/)
- [Lists, paragraphs and tables in cells](https://goingstellar.ro/reference/confluence-storage-format/content-in-cells/)

## Sources

- [Confluence storage format (Atlassian Documentation)](https://confluence.atlassian.com/doc/confluence-storage-format-790796544.html)
- [Atlassian Document Format: document structure (Atlassian Developer)](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/)

