Skip to main content
Feb 26, 2013 3:08 PM UTC
Question

Text alignment question

Hi guys

Just wondering if there is a way to keep two sentences in one string on the same line, but one aligned left, the other right using html or TLF?

So...

left margin>FIRST SENTENCE             SECOND SENTENCE<right margin

The string is being injected into a textflow, so it would need to work with either TEXT_FIELD_HTML_FORMAT or TEXT_LAYOUT_FORMAT.

I've imported css via a formatResolver, and have a class that colors and aligns the font. The color works, but aligning it does nothing.

Thanks for taking a look.

This topic is closed to new replies. Start a new post to keep the conversation going.

6 replies

kglad
Community Expert
Community Expert
Feb 26, 2013 3:24 PM UTC

you can use text-align in your css.

Translate
Feb 26, 2013 3:53 PM UTC

It doesn't do anything in span - but it does in <p> (or should I say - I'm doing something wrong).

text-align: right; (and I've tried textAlign: right;)

fontSize: 40;

color: 0xff00;

margin-left: 100px;

The font size and color works, so everything is communicating ok.

<p> does me no good, as I need the two sentences on the same line.

Translate
Nabren
Inspiring
Feb 26, 2013 3:59 PM UTC

What if you fake this? Put two TextFields on top of each other with the same width and height then align the first one left and the second one right. I tried to play with aligning it properly in a single TextField but it seems impossible without doing math and just inserting spaces procedurely.

Translate