Home/Jira formatting reference
Jira text formatting
Merged cells and table options in Jira (ADF only)
Wiki markup has no syntax for merged cells, cell colours or numbered rows. ADF has them as attributes: colspan, rowspan, background on a cell and isNumberColumnEnabled on the table. v2 shows such tables as an {adf} block.
Wiki markup
There is no wiki markup for this element.
Stored as ADF (REST API v3)
The ADF document Jira Cloud stores for ADF:{"content": [{"attrs": {"isNumberColumnEnabled": false, "layout": "default"}, "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": "a", "type": "text"}], "type": "paragraph"}], "type": "tableCell"}, {"content": [{"content": [{"text": "b", "type": "text"}], "type": "paragraph"}], "type": "tableCell"}], "type": "tableRow"}], "type": "table"}], "type": "doc", "version": 1}:
{
"type": "doc",
"version": 1,
"content": [
{
"type": "table",
"attrs": {
"isNumberColumnEnabled": false,
"layout": "default"
},
"content": [
{
"type": "tableRow",
"content": [
{
"type": "tableHeader",
"attrs": {},
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "H1"
}
]
}
]
},
{
"type": "tableHeader",
"attrs": {},
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "H2"
}
]
}
]
}
]
},
{
"type": "tableRow",
"content": [
{
"type": "tableCell",
"attrs": {
"colspan": 2
},
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "merged"
}
]
}
]
}
]
},
{
"type": "tableRow",
"content": [
{
"type": "tableCell",
"attrs": {
"background": "#deebff"
},
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "a"
}
]
}
]
},
{
"type": "tableCell",
"attrs": {},
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "b"
}
]
}
]
}
]
}
]
}
]
}
Examples
ADF (API v3)
{"content": [{"attrs": {"isNumberColumnEnabled": false, "layout": "default"}, "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": "a", "type": "text"}], "type": "paragraph"}], "type": "tableCell"}, {"content": [{"content": [{"text": "b", "type": "text"}], "type": "paragraph"}], "type": "tableCell"}], "type": "tableRow"}], "type": "table"}], "type": "doc", "version": 1}Merge two columns in one row and colour a cell. The values are kept in the stored ADF.
Rendered by Jira (HTML)
<!-- ADF macro (type = 'table') -->Back to wiki after the round trip
{adf:display=block}
{"type":"table","attrs":{"isNumberColumnEnabled":false,"layout":"default"},"content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"H1"}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"H2"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":2},"content":[{"type":"paragraph","content":[{"type":"text","text":"merged"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"background":"#deebff"},"content":[{"type":"paragraph","content":[{"type":"text","text":"a"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"b"}]}]}]}]}
{adf}Sent to Jira Cloud on .
ADF (API v3)
{"content": [{"attrs": {"isNumberColumnEnabled": true}, "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": {"rowspan": 2}, "content": [{"content": [{"text": "rowspan", "type": "text"}], "type": "paragraph"}], "type": "tableCell"}, {"content": [{"content": [{"text": "x", "type": "text"}], "type": "paragraph"}], "type": "tableCell"}], "type": "tableRow"}, {"content": [{"content": [{"content": [{"text": "y", "type": "text"}], "type": "paragraph"}], "type": "tableCell"}], "type": "tableRow"}], "type": "table"}], "type": "doc", "version": 1}Merge two rows in the first column and turn on the number column.
Rendered by Jira (HTML)
<!-- ADF macro (type = 'table') -->Back to wiki after the round trip
{adf:display=block}
{"type":"table","attrs":{"isNumberColumnEnabled":true},"content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"H1"}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"H2"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"rowspan":2},"content":[{"type":"paragraph","content":[{"type":"text","text":"rowspan"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"x"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"y"}]}]}]}]}
{adf}Sent to Jira Cloud on .
ADF (API v3)
{"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}Put an expand block inside a table cell. The cell renders as an ADF macro placeholder in HTML.
Rendered by Jira (HTML)
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'><!-- ADF macro (type = 'nestedExpand') --></td>
</tr>
</tbody></table>
</div>
Back to wiki after the round trip
|{adf:display=block}
{"type":"nestedExpand","attrs":{"title":"More"},"content":[{"type":"paragraph","content":[{"type":"text","text":"inside"}]}]}
{adf}|Sent to Jira Cloud on .
What changes in conversion
- v2 cannot write these tables as wiki. It returns
{adf:display=block}, the whole table as JSON, then{adf}. - The v2 HTML contains only the comment
<!-- ADF macro (type = 'table') -->for a table with merged cells, so the content is not visible there. - The nested expand case is different: v2 still draws the table and puts the ADF macro inside the cell (
|{adf:display=block} ... {adf}|). - ADF keeps
colspan,rowspan,backgroundandisNumberColumnEnabledexactly as sent in these runs.
Pitfalls
- Editing such a field through v2 and wiki markup risks losing the merged cells. Use v3 and ADF.
- A reader using the REST v2 output sees an
{adf}block, which is not valid wiki markup to reformat by hand. - The ADF documentation says tables are supported on web and desktop only, not on mobile.