Home/Confluence storage format reference
Confluence storage format
Lists, paragraphs and tables inside table cells
A td or th can hold block content, not only text: lists, paragraphs, other tables and macros. The round trip keeps the structure and adds a paragraph inside every list item. A collapsible section inside a cell is stored as the expand macro.
Storage format
<td><ul><li>item</li></ul><p>text</p></td>
<td><table><tbody><tr><td>inner</td></tr></tbody></table></td>
As ADF (Confluence Cloud)
The ADF that Confluence Cloud builds for:
ADF:{"content": [{"content": [{"content": [{"content": [{"attrs": {"title": "More"}, "content": [{"content": [{"text": "inside", "type": "text"}], "type": "paragraph"}], "type": "nestedExpand"}], "type": "tableCell"}], "type": "tableRow"}], "type": "table"}], "type": "doc", "version": 1}
{
"type": "doc",
"content": [
{
"type": "table",
"attrs": {
"layout": "default"
},
"content": [
{
"type": "tableRow",
"content": [
{
"type": "tableCell",
"attrs": {
"colspan": 1,
"rowspan": 1
},
"content": [
{
"type": "nestedExpand",
"attrs": {
"title": "More"
},
"content": [
{
"type": "paragraph",
"content": [
{
"text": "inside",
"type": "text"
}
]
}
]
}
]
}
]
}
]
}
],
"version": 1
}
Examples
Storage format sent
<table><tbody><tr><td><ul><li>list in cell</li></ul><p>para</p></td></tr></tbody></table>A bullet list followed by a paragraph in one cell, for a cell that needs a few lines of structure.
Rendered view (HTML)
<div class="table-wrap"><table class="confluenceTable"><tbody><tr><td class="confluenceTd"><ul><li>list in cell</li></ul><p>para</p></td></tr></tbody></table></div>Storage format after the round trip through ADF
<table data-layout="default"><tbody><tr><td><ul><li><p>list in cell</p></li></ul><p>para</p></td></tr></tbody></table>Sent to Confluence Cloud on .
Storage format sent
<table><tbody><tr><td><table><tbody><tr><td>nested table</td></tr></tbody></table></td></tr></tbody></table>A table inside a table cell, used for a grid within a grid.
Rendered view (HTML)
<div class="table-wrap"><table class="confluenceTable"><tbody><tr><td class="confluenceTd"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><td class="confluenceTd">nested table</td></tr></tbody></table></div></td></tr></tbody></table></div>Storage format after the round trip through ADF
<table data-layout="default"><tbody><tr><td><table data-layout="default"><tbody><tr><td><p>nested table</p></td></tr></tbody></table></td></tr></tbody></table>Sent to Confluence Cloud on .
Storage format sent
ADF:{"content": [{"content": [{"content": [{"content": [{"attrs": {"title": "More"}, "content": [{"content": [{"text": "inside", "type": "text"}], "type": "paragraph"}], "type": "nestedExpand"}], "type": "tableCell"}], "type": "tableRow"}], "type": "table"}], "type": "doc", "version": 1}A collapsible section inside a cell, created from ADF as a nestedExpand node with a title.
Rendered view (HTML)
<div class="table-wrap"><table data-layout="default" class="confluenceTable"><tbody><tr><td class="confluenceTd"><div class="expand-container conf-macro output-block" data-hasbody="true" data-macro-id="<id>" data-macro-name="expand" id="expander-1528453007"><div id="expander-control-1528453007" class="expand-control"><span class="expand-control-icon icon"> </span><span class="expand-control-text">More</span></div><div id="expander-content-1528453007" class="expand-content expand-hidden"><p>inside</p></div></div></td></tr></tbody></table></div>Storage format after the round trip through ADF
<table data-layout="default"><tbody><tr><td><ac:structured-macro ac:name="expand" ac:schema-version="1" ac:macro-id="<id>"><ac:parameter ac:name="title">More</ac:parameter><ac:rich-text-body><p>inside</p></ac:rich-text-body></ac:structured-macro></td></tr></tbody></table>Sent to Confluence Cloud on .
What changes in conversion
- A list and a paragraph in one cell both come back, in the same order. Each li gains a p element around its text.
- A nested table is kept inside the cell and the inner table also gets data-layout="default".
- An ADF nestedExpand in a table cell is written as the expand macro, with its title as a title parameter and the body in ac:rich-text-body, and renders as a collapsed expand control.
Pitfalls
- The expand inside a cell is a nestedExpand node in ADF, but the stored form is an ordinary expand macro, so storage alone does not show it came from a cell.
- Cell text written without a p comes back inside a p after the editor saves the page, and list items get the same treatment.
- Only one level of nesting was probed for tables and for the expand. Deeper structures were not run.