Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do you make 2 column Table of Contents

mark kalinsky March 16, 2020

Afternoon,

 

How do you make in a confluence page, a 2 column Table of Contents to save space. I understand we can split pages sections but I can't see a way to have a table of contents spread over to the space next to it which is empty.

3 answers

1 vote
David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
March 16, 2020

For Confluence Cloud 🙁

If the web address of your Confluence instance is something like https://yourcompanyname.atlassian.net, that means you are on Confluence Cloud and as a result you will not be able to do this.

For Confluence Server 🎉

Otherwise you are probably on Confluence Server, in which case, you can create your own user macro to achieve this.

Get an administrator to add the following user macro:

## Macro name: toc-2columns
## Macro title: Table of Contents in 2 Columns
## Macro has a body: No
## Developed by: David Simpson <community.atlassian.com@davidsimpson.me>
## Date created: 2020-03-16
## Installed by: Your Name
##
## @noparams

<div style="columns: 400px 2;">
<ac:structured-macro ac:name="toc" ac:schema-version="1" />
</div>

 This user macro simply adds some formatting around the Table of Contents macro to split it into 2 columns.

Carina Heinrich July 13, 2022

Hi David,
thank you very much for sharing the instruction. It works fine for me.

Could you please let me know what to add in the macro code for hiding heading 3 and below?

I tried the following taken from the default toc-macro code but it doesn't work ...

ac:data-macro-parameters="maxLevel=2"

Thanks a lot in advance!

Regards, Carina

0 votes
Caroline Burgess August 22, 2023

So here is another way to do this without using a macro or having to use a static list.

Set up 2 columns - (column A and column B) either with panels or a table.

  • Column A:
    • Set all of the headers that you want to appear in this column as Heading 1
    • In the TOC settings, set 'include heading levels from' to 1 and "to" to 1
  • Column B:
    • Set all of the headers that you want to appear in this column as Heading 2
    • In the TOC settings, set 'include heading levels from' to 2 and "to" to 2
0 votes
Jesse Howard January 20, 2023

I don't have Admin permissions, so the macro option was not viable for me. But, I was able to come up with a solution all the same. Please remember that a Table of Contents (ToC) is nothing more than a collection of links to fixed references on the page via Headers.

Here are the steps I used:

  1. Created a standard ToC to establish a list of links (this is the original Table of Contents).
  2. Created a table with the appropriate number of rows and columns desired for a split ToC (in this case; 4 columns with 3 rows).
    • The first row serves as a Title row.
    • The second row also serves as a Header row.
    • The third row serves as a Child Link row
  3. Merged all cells in the top row and entered the text: "Table of Contents" in the row.
  4. Pasted each H1 link into the cells on the second row (effectively serving as H1 section names and links to the H1 headers).
  5. Inserted the Expand macro into all cells on the third row 
  6. Pasted all child links below each H1 link into the Expand macro field on the last row.

The net effect was to have a split ToC that used the entire width of the page, with no white space. And, as a bonus, the bulk of the table was collapsible except for the Title and Header row (thanks to the Expand macro):


Table of Contents.png


Issues with this Solution:

  • The links are static, not dynamic
  • While the links can be edited, no new links will be added, nor will link changes in the original ToC be reflected
  • If you update any header information on the page, you will have to edit the link in the new table
  • The original ToC is dynamic and can be used for copying current links to the table

Tip!  You can insert the original Table of Contents inside the Expand macro to hide it.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events