ditaa icon indicating copy to clipboard operation
ditaa copied to clipboard

How to centre text in a box?

Open cocowalla opened this issue 5 years ago • 1 comments

I'm having difficulty centring text across 2 lines in a box, depending on the length of both lines. For example:

+--------------+
|  Some text   |
| across lines |
+--------------+

It seems that no matter what I try, when this diagram is rendered the top line is always either left or right aligned, never centred.

Would appreciate some guidance!

cocowalla avatar Sep 25 '18 19:09 cocowalla

I think centering is an extremely tricky behavior and it probably is a good idea to fix this issue. So far, the way I deal with this is this

 +-------------+
 |  some text  |
 | across lines| 
 +-------------+

This sort of centers the text but leaves more white space after the text ends. @cocowalla

lljr avatar Jan 28 '19 22:01 lljr