How to make Pagetree macro centered

On my title page, I want the following items to be centered: the heading, some text, a Livesearch macro, and a Pagetree macro.

When I display the page, it's all centred nicely, for a split second. Then, the Pagetree macro jumps to the left. The rest of the content stays centered.

I've tried these ways of forcing centering via editing the wiki markup:

  • <div align="center"> </div> around all of the content 
  • style="text-align: center;" in each element 
  • Both the div and the style

None works. Any advice?

2 answers

1 accepted

You can do it with the Div macro:

Put the Page Tree macro in the body and add 

margin-left: auto; margin-right: auto; width: 18em

to the Styles field. You can play with the nem amount to control line wrap.

Thanks Milo

Unfortunately the Confluence administrator won't let us use the HTML macro, which I think would let me use the Div macro.

The Div macro is its own thing, is pre-installed and turned on by default in both Cloud and Server, and has nothing to do with the HTML macro.

Steven Behnke Community Champion Jun 15, 2016

It is not pre-installed in server actually. It's part of Adaptavist Content Formatting Macro's I believe. 

That happens to be currently pre-installed in Cloud however.

Thanks Steven - that must be why I don't see it.

In addition, I wonder if it actually would work, given what you said about the Pagetree macro including a block element.

I stand corrected (the Content Formatting Macros are just so useful). Regardless, I actually tried it before I posted the answer to make sure it worked:

image2016-6-16 9:6:46.png

Steven Behnke Community Champion Jun 16, 2016

Sweet! Yeah, that must override the nature of the block div by forcing margins and width.

Melanie, the content formatting macros are Free/Paid. The Div/Style macros are included under the FREE macros. Just a thought! 

Thanks, Milo!  This worked great for me on the server 5.8 version...and I used it with the pagetreesearch macro.

0 vote
Steven Behnke Community Champion Jun 14, 2016

The plugin is wrapped in a DIV which is a block element. It occupies the entire space given to it and thus cannot just be "justified."

I don't really see an easy way to change that behavior.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Tuesday in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

420 views 18 9
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you