Page 1 of 1

Right align text in a plain text field?

Posted: 01 Mar 2018
by tharais
Good morning..

I've searched around the forum looking for the answer to how to right align text in a plain text field on a form.
I've tried to use css and define a class and to just enter "text-align: right" in the style field of the control... neither seemed to work.
Can someone shed some light on how I can do this?

thanks!

Re: Right align text in a plain text field?

Posted: 02 Mar 2018
by Nikita Kurguzov
Dear tharais,
The code depends on the type of the Plain text field - is it Single Line or Multiple Lines?

First, give the field a CSS class, like this:
SignleLineClass.png
SignleLineClass.png (1013 Bytes) Viewed 1734 times
MultilineClass.png
MultilineClass.png (987 Bytes) Viewed 1734 times
Then, add the following code to CSS editor for Single Line:

Code: Select all

.signleline input{
	text-align: right;
}
Or the following code for Multiple Lines:

Code: Select all

.multiline textarea{
	text-align: right;
}
Here's what I get in the browser with this code:
RightAlign.png
RightAlign.png (2.78 KiB) Viewed 1734 times

Re: Right align text in a plain text field?

Posted: 08 Mar 2018
by tharais
Nikita..

Thanks for the reply.. I think I incorrectly asked my question.
Im using just a plain text control not a text input box. I just want to right align the plain text in the box.

thanks!

TJ

Re: Right align text in a plain text field?

Posted: 12 Mar 2018
by Nikita Kurguzov
Dear TJ,
Okay I see. The easiest option would be to add a Table control to the form. Then you can simply move Plain Text control to the right side of all the fields:
TableRightText.png
TableRightText.png (43.31 KiB) Viewed 1723 times
P.S. You can also add padding to the left.

Re: Right align text in a plain text field?

Posted: 13 Mar 2018
by tharais
thanks.. I got it figured out.. I used css and finally got the syntax correct :)