Right align text in a plain text field?

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
tharais
Posts: 11
Joined: Wed Mar 29, 2017

01 Mar 2018

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!

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

02 Mar 2018

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 1731 times
MultilineClass.png
MultilineClass.png (987 Bytes) Viewed 1731 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 1731 times
Cheers

tharais
Posts: 11
Joined: Wed Mar 29, 2017

08 Mar 2018

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

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

12 Mar 2018

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 1720 times
P.S. You can also add padding to the left.
Cheers

tharais
Posts: 11
Joined: Wed Mar 29, 2017

13 Mar 2018

thanks.. I got it figured out.. I used css and finally got the syntax correct :)

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests