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

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Managing code block width

I am trying to include a code block in a page while documenting some stuff. If i try to put a code block under a sub-section (i.e., not really to the left-most side), then even in that case, the code block is aligned to the left-most side as shown in the attachment. Is there a way (without getting Administrator involved) i can align it so it starts just under the sub-section?

Confluence - Code Block Alignment.png

2 answers

0 votes

Hi @GC,

I assume using a table would not be an elegant solution but that you could do? I mean it's just a quick and silly idea.

Hi @Krisztian Kovacs,

That's right. It doesn't look elegant :( and i have also tried aligning tables earlier for similar use-case where i wanted to create it under a sub-section. That too doesn't budge from its leftmost position.

0 votes
Lars Vagt I'm New Here Sep 21, 2020

Maybe others still have the same question, although some time has gone.

In order to add the code block in continuation of your list item, you need to do this:

  1. Go to the end of the list item, the box shall belong to. In your above example, your cursor should be right after "... to application's directory:".
  2. Add a pure line break (Shift + Enter). In the above example, the cursor is on a new line beneath "Run" now, but there is no new item "b)".
  3. Add the code block macro, for instance typing "{code" and selecting it. The code block just starts where your cursor was before.

In order to continue the current item with more text, you can just click to the right of the code block, and make another line break (Shift + Enter).

If you wanted to add a new item, you would make a real paragraph break (Enter without Shift).

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence

Announcing Team Calendars in Confluence Data Center

Hi Community! We're thrilled to share that Team Calendars for Confluence is now a built-in feature for Confluence Data Center releases 7.11 and beyond.  A long time favorite,  Team Cale...

146 views 0 5
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you