Page 1 of 1

TextAlignment in TableColumns (RPG/DDS)

Posted: Thu Jul 19, 2012 5:46 pm
by JoeHam
Hello everybody,

we are quite new in developing with longrange and after finishing the tutorials we started to create our own applications.
Now we have a question concerning the design of the app:
How can we align text in table columns (column type: label)? It seems that by default text alignment is "left" - how can we change this for single columns?

Many thanks in advance!

Re: TextAlignment in TableColumns (RPG/DDS)

Posted: Thu Jul 19, 2012 6:18 pm
by tsupartono
You can use the 'TextAlign' property ('TextAlign' is one of the properties of a label).

To change the 'TextAlign' property of all labels in one column, you prefix it with 'Content' property.
Example below change text alignment of first column to 'Center'

Code: Select all

     A                                       Col%1
     A                                       (
     A                                         Content.TextAlign: Center
     A                                         Name: NAME
     A                                         Type: Label
     A                                         Header.Value: "Name"
     A                                       )
So 'Content' basically acts like a template for all labels in that column - so when you change a property of the 'Content', that affects all labels in that column.

If you want, you can also change TextAlign (or any other properties) of an element in a particular row only.
For example, to change the TextAlign for the NAME column, just for the second row (Row%2) to 'Center':

Code: Select all

     A
     A                                       Row%2.NAME.TextAlign: Center
     A