How do I indent text consistently within a table cell?
Asked by Scott Gartner:

I'm trying to create a table for annotating an XML format in our Wiki. The table has two columns, the left one has cells that contain XML that needs to be properly indented and have a fixed-width font. The right is text that needs to have full formatting.

My problem is that if I make the left cells Preformatted it still doesn't honor the horizontal space within the XML snippets. I've tried using various macros like "No Format" but it keeps screwing up the table when I insert data into the cells (not to mention that inserting dozens of these macros is a tedious process, to say the least).

I've seem some discussion about creating my own macro, but it seems that all I could reasonably do was to try to add styles to an existing table. I'm not sure how this will solve my problem. Any macro that needs to be inserted into every left cell is going to take forever to do.

I've also tried adding the \&nbsp; XML entity, but it just prints "\&nbsp;" (presumably since I have to choose preformatted to get a fixed-width font).

Help?  
[](https://community.atlassian.com/t5/Confluence-questions/How-do-I-indent-text-consistently-within-a-table-cell/qaq-p/302435?attachment-id=7097){#link_11874df49c4f1c}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/51049/1/image2016-2-23%2013%3A19%3A28.png){#display_11874df49c4f1c_0}  
[](https://community.atlassian.com/t5/Confluence-questions/How-do-I-indent-text-consistently-within-a-table-cell/qaq-p/302435?attachment-id=7098){#link_11874df49c4f1c_0}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/51049/2/image2016-2-23%200%3A23%3A41.png){#display_11874df49c4f1c_2}  
[](https://community.atlassian.com/t5/Confluence-questions/How-do-I-indent-text-consistently-within-a-table-cell/qaq-p/302435?attachment-id=7099){#link_11874df49c4f1c_1}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/51049/3/image2016-2-23%2013%3A20%3A8.png){#display_11874df49c4f1c_4}  
[](https://community.atlassian.com/t5/Confluence-questions/How-do-I-indent-text-consistently-within-a-table-cell/qaq-p/302435?attachment-id=7100){#link_11874df49c4f1c_2}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/51049/4/PageDisplayScreenShot.jpg){#display_11874df49c4f1c_6}  
[](https://community.atlassian.com/t5/Confluence-questions/How-do-I-indent-text-consistently-within-a-table-cell/qaq-p/302435?attachment-id=7101){#link_11874df49c4f1c_3}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/51049/5/EditingScreenShot.jpg){#display_11874df49c4f1c_8}  
[](https://community.atlassian.com/t5/Confluence-questions/How-do-I-indent-text-consistently-within-a-table-cell/qaq-p/302435?attachment-id=7102){#link_11874df49c4f1c_4}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/51049/6/image2016-2-23%200%3A24%3A21.png){#display_11874df49c4f1c_10}  
[](https://community.atlassian.com/t5/Confluence-questions/How-do-I-indent-text-consistently-within-a-table-cell/qaq-p/302435?attachment-id=7103){#link_11874df49c4f1c_5}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/51049/7/image2016-2-23%200%3A26%3A32.png){#display_11874df49c4f1c_12}


Answers:
author: Steven F Behnke
body: I think the real question here is, "How do I insert a non-breaking space into Confluence?"  
image2016-2-22 19:18:9.png

It's... Maybe a bit silly. The non-breaking space or `nbsp;` can be inserted by selecting the symbol... which is invisible. In this screenshot I've 'focused' on it so it's easier to see.

image2016-2-22 19:18:21.png

The confluence content can be inserted right into the editor and it renders successfully.

image2016-2-22 19:18:27.png

|                                                                                                        Sample                                                                                                        |                                                                                                                 Summary                                                                                                                 |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ``` <namedGroup name="BaseDistricts">    <RE>TEMP_.*</RE>    <exclusions>        <groups>            <group name="Masters" />            <group name="Special" />        </groups>    </exclusions></namedGroup> ``` | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. |

[](https://community.atlassian.com/t5/Confluence-questions/How-do-I-indent-text-consistently-within-a-table-cell/qaq-p/302435?attachment-id=1149){#link_11874dfe65bc32}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/51053/1/image2016-2-22%2019%3A18%3A27.png){#display_11874dfe65bc32_0}  
[](https://community.atlassian.com/t5/Confluence-questions/How-do-I-indent-text-consistently-within-a-table-cell/qaq-p/302435?attachment-id=1150){#link_11874dfe65bc32_0}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/51053/2/image2016-2-22%2019%3A18%3A9.png){#display_11874dfe65bc32_2}  
[](https://community.atlassian.com/t5/Confluence-questions/How-do-I-indent-text-consistently-within-a-table-cell/qaq-p/302435?attachment-id=1151){#link_11874dfe65bc32_1}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/51053/3/image2016-2-22%2019%3A18%3A21.png){#display_11874dfe65bc32_4}

comments: author: Scott Gartner
body: Thank you, I had not seen that "non-breaking space" symbol in the symbol list.

However, this is not really a great solution since if I cut/paste that "symbol" out of the wiki it just cuts as 0x20 (which is a normal space character). This means that I have to copy and paste all of the XML snippets then manually go back through each line and change each leading space to the "non-breaking space" symbol. This is painful.

Hopefully someone will chime in with a less manual solution.


author: Steven F Behnke
body: Well good luck then... I can enter non-breaking spaces with **alt-space** and my text editor of choice inserts non-breaking spaces when I use 'tab.' The only reason I suggest these things is because you mentioned you were trying to use `nbsp;` to achieve this and well... `nbsp;` works just fine.


author: Scott Gartner
body: It was a lot of work, and for some reason the Wiki editor really didn't like me pasting in blocks of non-breaking spaces (it kept moving the entire block to its own line), but this did work for me in the end. Thank you!


author: Steven F Behnke
body: I'm glad. I wonder if there's a feature improvement we could raise on JAC.


author: Scott Gartner
body: BTW, when you say that your "text editor of choice" let's you insert nbsp with alt-space, do you mean that you can insert some character in an external editor and have it paste in as the right symbol in the wiki?

I tried editing the text in Word and inserting nbsp there, but the Wiki editor didn't ever paste it correctly (it was more often than not so messed up as to be unusable). If I try pasting text out of the wiki to SlickEdit it pastes the nbsp as a normal space character (0x20).

What editor are you using and what is it inserting into the buffer in that editor when you use alt-space? The syntax highlighting all copies just fine from SlickEdit, but if I insert the Unicode nbsp character (0xA0) it pastes into the wiki as a "?". This would be relatively easy if I could just translate all spaces at the beginning of each line into a nbsp and then just cut and paste into the wiki.


author: Steven F Behnke
body: I am on Confluence 5.9.5, if relevant. My client machine is on OSx so I am not sure if an OS difference is affecting us. First, I tested this with normal spaces -- They do not paste cleanly and Confluence gobbles them up as "extra" whitespace (as HTML applications usually do).

I am able to use OSx shortcut **Alt** + **Space** in any text editor, I tried the basic ++textEdit++ and one of my favorites ++Text Wrangler++. Both of these editors accept the non-breaking space and further I can copy it from textEdit or Text Wrangler to Confluence easily, or I can simply write directly into Confluence. I have no issues inserting these from my keyboard into Confluence.

My scripting usually takes place in ++Code Runner 2++ , when I press **Tab** it inserts non-breaking spaces for me as well.


author: Scott Gartner
body: As to your feature improvement comment, I started looking into macros, but they didn't seem to be focused on the right things. However, from an ease of use standpoint, they could allow us to put often-used macros directly in the "insert more" menu (or the context menu for "{"). I did figure out that I could search in the context menu for "{" which is better, but still not perfect since I could find no way except using the mouse (click on the macro box and then click edit) to click the nopanel check box. I was thinking I should just write a custom macro, but hadn't really gone far down the road to do that (and there are so many now, that it's possible that one of them would do what I want). If I were to write my own, I would make it build the proper table from an unordered list or something.

It is nice that you can highlight text and it will wrap the macro around that, and (with some difficulty) you can cut/paste macro insertions. But it seems like there could be some syntax that would let me invoke a macro myself. Something like

"{macro:No Markup, nopanel="true"}text{macro}"

or something, which I could paste from the clipboard. I'm guessing this from other comments that hint that maybe you used to be able to do that, and, in fact, their own [wiki-markup tutorial](https://confluence.atlassian.com/doc/confluence-wiki-markup-251003035.html#ConfluenceWikiMarkup-TextEffects)mentions "{color:red}text{color}" which apparently no longer works. All-in-all I really wish they just provided a "wiki markup" view of the page, so that I could edit the codes myself (like Wikimedia does) even if they translate them in and out of the codes under the hood to some internal format (they indicate that's what's happening anyway).

I was going to type all of this into a suggestion on [jira.atlassian.com](http://jira.atlassian.com), but it was down and I didn't want to lose it.

Thanks again for your help.


author: Steven F Behnke
body: No problem. It's too bad you've had difficulty.

**Alternatives**

There is a Wiki/Markdown insert option --   
image2016-2-23 0:24:21.png  
image2016-2-23 0:23:41.png

You can also use the wiki macro --   
{wiki}

Finally, Server (not Cloud) has an add-on called Source editor that let's you modify the HTML --   
image2016-2-23 0:26:32.png


author: Scott Gartner
body: I'll look into the manual markup insertion.

I assume that we have "cloud" since we aren't running any Atlassian software on any of our machines.

Thanks again!


author: Steven F Behnke
body: Confluence won't usually be running locally on your desktop or laptop, but you'll have it administered as an "application" by your IT department if it's "server" version. If you have Server version I urge you to get the Source Editor, I use it constantly as a power-user.

Here's a trick to easily tell what confluence you're on --

* If your URL is hosted at *domain* .**atlassian.net** /wiki or *domain* .**jira.com**/wiki, you're on JIRA Cloud. (such as blackpearlpdm.atlassian.net/wiki)
* If it's hosted anywhere else, you have Server version. (such as confluence.blackpearlpdm.com)

By improvement, I think there's opportunity here -- You're a common use-case, code (XML even) in Confluence pages. For some reason, you're unable to easily paste non-breaking spaces into a page. Some environment variable is preventing that from working (since it works fine for me) and I think that means there's a bug or a improvement that can be made. I'm not sure how to find this bug with you though.

The Confluence Editor is constantly improving, I'm certain the experience will continue improving.


author: Steven F Behnke
body: So... Something like this?

|                                                                                                        Sample                                                                                                        |                                                                                                                 Summary                                                                                                                 |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ``` <namedGroup name="BaseDistricts">    <RE>TEMP_.*</RE>    <exclusions>        <groups>            <group name="Masters" />            <group name="Special" />        </groups>    </exclusions></namedGroup> ``` | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. |
| ``` <databaseGroups>    <group name="Clam Districts" /></databaseGroups> ```                                                                                                                                         | Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, .                                                                                                                                     |
| ``` <workUnit name="Some Name"continueOnError="false"timeoutMinutes="10"> ```                                                                                                                                        | At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum.                                                                                                                                       |


author: Scott Gartner
body: Steven,

OK, here are two screen shots. In the left column you can see one where I have inserted a No-Format macro, which works, but I can't do any syntax highlighting and I have to do several clicks and searches to insert every No Format, and sometimes when the No Format is inserted the remainder of the table goes awry. The columns below are marked Preformatted and have spaces and syntax highlighting. I've tried all sorts of suggestions mined from the forums, but nothing really works except the No Format macro, which is painful.

Obviously the page I am showing here was manufactured just for the forum, but is indicative of the problem. There are 30-40 sections documenting the XML document format. The way I created it (before trying the No Format macro) was to load a sample XML document into an editor (SlickEdit in this case) which provides the syntax highlighting, which I then pasted into the Wiki and started writing the documentation. I've been living with the lack of indenting for some time, but I just added a big new feature to the XML and it just seems like this should be easier.

Thanks for any ideas. Images below:

EditingScreenShot.jpg

PageDisplayScreenShot.jpg


author: Steven F Behnke
body: It'd be nice to see an example. This is hard to visualize.


Tags: cloud

confluence-cloud

format

markup

user-macro

wiki