panels with headers
Asked by Jacob Ingram:

*This question is in reference to Atlassian Documentation: [Panel Macro](https://confluence.atlassian.com/doc/panel-macro-51872380.html)*

I'm working on templates for my team. Is there a way to associate panels to a table of contents? Either with headers or something I haven't thought of?

Thanks for the advice!


Answers:
author: Milo Test
body: Here's a kludgy option. Add a div within a panel and turn it into the title:

image2016-12-16 17:57:25.png

Making the text in the Div macro a heading style will get it listed in the TOC:

image2016-12-16 17:39:50.png

Here is the CSS I have in the Style field of the Div Macro:

```
background: pink; position: relative; left: -10px; top: -10px; padding-left: 10px; padding-top: 5px; padding-bottom: 5px; width: 110%;
```

[](https://community.atlassian.com/t5/Confluence-questions/panels-with-headers/qaq-p/60210?attachment-id=5104){#link_1185fed2e986fc}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/168889/1/image2016-12-16%2017%3A57%3A25.png){#display_1185fed2e986fc_0}  
[](https://community.atlassian.com/t5/Confluence-questions/panels-with-headers/qaq-p/60210?attachment-id=5105){#link_1185fed2e986fc_0}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/168889/2/image2016-12-16%2017%3A39%3A50.png){#display_1185fed2e986fc_2}

comments: author: Michelle Rau HP
body: This solution worked pretty well for me. Thank you for the great example!


author: Nicolas Belland
body: Works for me too. Many thanks Milo.


author: Dario
body: Hi [@Milo Test](/t5/user/viewprofilepage/user-id/781527)

How to apply this solution in automatic way? I would like to change more than 2000 pages with this issue.

Thank you in advance.

Dario


author: Michelle Rau HP
body: The workaround I had been using was to put a heading level 6 just above the panel, and turn it white to become invisible. The small text doesn't create too big of a visual gap between panels.

Then I set the TOC to only display heading 6.

![panel_workaround.png](https://community.atlassian.com/t5/image/serverpage/image-id/84377i2736F9AF36E51DF3/image-size/large?v=v2&px=999 "panel_workaround.png")


author: Sam Hall
body: Hi Jacob,

Are you looking for a way to get the panel macro's "title" to show up in a table of contents for a page?

If so, it's not possible as far as I know, but there is a feature suggestion here which you could vote on:

<https://jira.atlassian.com/browse/CONF-37130>

Possible options which might get close to what you want are:

* Put headings inside the panel content, so that they are picked up by the table of contents macro.
* Put [anchors](https://confluence.atlassian.com/doc/anchors-139442.html) inside the panel content. Put links to the anchors at the top of your page.

See also: <https://answers.atlassian.com/questions/12269217>

comments: author: Dario
body: Hi [@Sam Hall](/t5/user/viewprofilepage/user-id/781608)

I have the same issue here and I am trying to apply your first option (**Put headings inside the panel content, so that they are picked up by the table of contents macro.** ). But my problem is ++how to apply it in automatic way++. I mean, I have more than 2000 pages with this issue and I would like to modify them in one shot instead one by one.

Thank you in advance.

Dario


author: Steven F Behnke
body: Can you maybe provide an example of what you'd like for the desired output, and an explanation of how you'd like it to work in the editor?


Tags: documentation