Going Stellar

Home/Jira formatting reference

Jira text formatting

Tables in Jira: ||header|| and |cell| markup versus ADF

Double bars mark header cells and single bars mark normal cells, one row per line. Wiki markup supports it everywhere, and Cloud stores the result as a table node with tableRow, tableHeader and tableCell children.

Wiki markup

||heading 1||heading 2||heading 3||
|col A1|col A2|col A3|

Stored as ADF (REST API v3)

The ADF document Jira Cloud stores for ||heading 1||heading 2||heading 3|| |col A1|col A2|col A3| |col B1|col B2|col B3|:

{
 "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": "heading 1",
           "marks": [
            {
             "type": "strong"
            }
           ]
          }
         ]
        }
       ]
      },
      {
       "type": "tableHeader",
       "attrs": {},
       "content": [
        {
         "type": "paragraph",
         "content": [
          {
           "type": "text",
           "text": "heading 2",
           "marks": [
            {
             "type": "strong"
            }
           ]
          }
         ]
        }
       ]
      },
      {
       "type": "tableHeader",
       "attrs": {},
       "content": [
        {
         "type": "paragraph",
         "content": [
          {
           "type": "text",
           "text": "heading 3",
           "marks": [
            {
             "type": "strong"
            }
           ]
          }
         ]
        }
       ]
      }
     ]
    },
    {
     "type": "tableRow",
     "content": [
      {
       "type": "tableCell",
       "attrs": {},
       "content": [
        {
         "type": "paragraph",
         "content": [
          {
           "type": "text",
           "text": "col A1"
          }
         ]
        }
       ]
      },
      {
       "type": "tableCell",
       "attrs": {},
       "content": [
        {
         "type": "paragraph",
         "content": [
          {
           "type": "text",
           "text": "col A2"
          }
         ]
        }
       ]
      },
      {
       "type": "tableCell",
       "attrs": {},
       "content": [
        {
         "type": "paragraph",
         "content": [
          {
           "type": "text",
           "text": "col A3"
          }
         ]
        }
       ]
      }
     ]
    },
    {
     "type": "tableRow",
     "content": [
      {
       "type": "tableCell",
       "attrs": {},
       "content": [
        {
         "type": "paragraph",
         "content": [
          {
           "type": "text",
           "text": "col B1"
          }
         ]
        }
       ]
      },
      {
       "type": "tableCell",
       "attrs": {},
       "content": [
        {
         "type": "paragraph",
         "content": [
          {
           "type": "text",
           "text": "col B2"
          }
         ]
        }
       ]
      },
      {
       "type": "tableCell",
       "attrs": {},
       "content": [
        {
         "type": "paragraph",
         "content": [
          {
           "type": "text",
           "text": "col B3"
          }
         ]
        }
       ]
      }
     ]
    }
   ]
  }
 ]
}

Examples

Wiki markup (API v2)

||heading 1||heading 2||heading 3||
|col A1|col A2|col A3|
|col B1|col B2|col B3|

Build the table from the Atlassian help: one header row and two body rows.

Rendered by Jira (HTML)

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>heading 1</th>
<th class='confluenceTh'>heading 2</th>
<th class='confluenceTh'>heading 3</th>
</tr>
<tr>
<td class='confluenceTd'>col A1</td>
<td class='confluenceTd'>col A2</td>
<td class='confluenceTd'>col A3</td>
</tr>
<tr>
<td class='confluenceTd'>col B1</td>
<td class='confluenceTd'>col B2</td>
<td class='confluenceTd'>col B3</td>
</tr>
</tbody></table>
</div>

Back to wiki after the round trip

||*heading 1*||*heading 2*||*heading 3*||
|col A1|col A2|col A3|
|col B1|col B2|col B3|

Sent to Jira Cloud on .

Wiki markup (API v2)

||A||B||
|only one|

A body row with fewer cells than the header. Jira does not pad the row.

Rendered by Jira (HTML)

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>A</th>
<th class='confluenceTh'>B</th>
</tr>
<tr>
<td class='confluenceTd'>only one</td>
</tr>
</tbody></table>
</div>

Back to wiki after the round trip

||*A*||*B*||
|only one|

Sent to Jira Cloud on .

Wiki markup (API v2)

||H||
|a|b|c|

A body row with more cells than the header. All three cells are kept.

Rendered by Jira (HTML)

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>H</th>
</tr>
<tr>
<td class='confluenceTd'>a</td>
<td class='confluenceTd'>b</td>
<td class='confluenceTd'>c</td>
</tr>
</tbody></table>
</div>

Back to wiki after the round trip

||*H*||
|a|b|c|

Sent to Jira Cloud on .

What changes in conversion

  • Header text is stored with a strong mark, so wiki read back from ADF writes ||*heading 1*|| where the input had ||heading 1||.
  • The stored table gets isNumberColumnEnabled: false and layout: default attributes, and every cell gets an empty attrs object.
  • Rows of different length stay different: the short row in the second example is not filled up with empty cells.

Pitfalls

  • A table needs each row on its own line, starting with a bar.
  • Do not count on header text staying unformatted after the field is saved in the new editor: bold is added.
  • Colspan, rowspan, cell colours and the number column have no wiki syntax. See the merged cells entry.

Sources

  1. Text Formatting Notation Help (Jira, in-product help)
  2. Atlassian Document Format: document structure (Jira Cloud platform)

Markdown version · All formatting pages