Skip to main content
February 26, 2013
Question

Text alignment question

  • February 26, 2013
  • 1 reply
  • 757 views

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 has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
February 26, 2013

you can use text-align in your css.

February 26, 2013

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.

Nabren
Inspiring
February 26, 2013

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.