Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to create bloc code with scrollbars

Proteus Six
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 20, 2019

Hi everybody,

I found How to insert a code block {code}{code}, but the problem that is if you have to paste a large sample of code you have to cut it into a few blocs and sometimes it has to be a little bit annoyed.

Is it possible to create a code block like a panel with scrollbars ?

3 answers

3 votes
Sireesha Dugginapeddi [Appfire]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 20, 2019

Hi @Proteus Six,

Yes! You can insert your code block into a div macro (Menu > Insert more content > Other macros > Formatting > div). In the style parameter of div macro, insert this -

overflow: scroll;

However, this would be needed if you set your div size (Your code block in turn) to a fixed height (min-height: 200px; max-height: 300px;). If not, the div takes the height/length of the code.

Hope this will work for you!

Thanks

Sireesha

Philip Rubins
Contributor
August 16, 2021

Where can I find 'menu' in my Jira ticket? There are several Hamburger buttons and Menu options on each Jira ticket. Can you be more specific on how how to find 'Insert more content'?

1 vote
Chris Thacker
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 17, 2023

Adding to the suggestion given, you can further stylize the css by specifying the size (width/height), border color, border type, etc.

 

Here is one example:

overflow: scroll; height: 300px; border: double; border-color:navy; border-width:5px;
0 votes
Kuniklocollective
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 27, 2025

Our version of confluence has no Div macro, so as a work around, I had to insert my own div using an HTML macro:

1) insert an HTML macro

2) Add the following div text in the html with whatever styling needed: 

<div style="overflow: scroll; height: 300px;">

3) Insert the code block

4) insert another HTML macro with the div ending:

</div>

 

A bit cumbersome, but it worked.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events