Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

How to left-align numerical input questions/answers

  • Skowronski
  • Skowronski's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 10 months ago #169023 by Skowronski
Hey there,
I have a numerical input question in my survey (asking for the age of participants).
The answer field is right-aligned, but I would like to left-align it.

Is there a way to do so?

Thanks!
Marika
The following user(s) said Thank You: JamesHarrisHKI
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 10 months ago #169030 by tpartner
LimeSurvey version?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • Skowronski
  • Skowronski's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 10 months ago #169037 by Skowronski
Version 3.7.1+180424
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 10 months ago #169055 by tpartner
To left-align all numeric inputs, add this to the end of custom.css:

Code:
.numeric-item input[data-number='1'] {
    text-align: left;
}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu, JamesHarrisHKI, skywalker23
The topic has been locked.
  • Skowronski
  • Skowronski's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 10 months ago #169056 by Skowronski
Thanks, that worked!
The topic has been locked.
More
4 years 2 weeks ago #196242 by mcovents
I want to do the same thing but this solution doesn't work for me. I have version 3.15.5+181115
Thanks in advance,
Marc.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 2 weeks ago #196246 by DenisChenu
Maybe try
Code:
.numeric-item input[data-number] {
    text-align: initial;
}

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
More
4 years 2 weeks ago #196250 by mcovents
No, but I was able to solve the issue by setting "Label column width" and "Text input box width" in "Display" to 8%
Thanks for your response.
Marc.
The topic has been locked.
More
3 years 5 months ago #207947 by ch123
Hey there!
I would like to do the same in Limesurvey 4.3. The code(s) above aren't working.
Is it still possible? :)

Thank you!
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 5 months ago #207954 by Joffm
Hi,
is there any reason to have numbers left aligned?
Anybody is used to see right aligned numbers.

I admit using the default setting a numeric question doesn't look the best.


But only with the setting of "Text input box width" to 17% and a suffix it is much better.


But if you insist in left-aligned numbers, I do not see an issue using tpartner's css (tested in 4.3.18)

To left-align all numeric inputs, add this to the end of custom.css:

Code:
.numeric-item input[data-number='1'] {
    text-align: left;
}



Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: ch123, skywalker23
The topic has been locked.
More
3 years 5 months ago #207956 by ch123
Ah oh no, completely my fault. I did not read the thread properly. I'm sorry...
In my case it's about having the labels before the numerical input left-aligned - I like it better when using multiple numerical input. The input itself/numbers are better on the right, as you write, Joffm.
I am really sorry for the confusion!
Do you have the right code for this too?
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 5 months ago - 3 years 5 months ago #207958 by Joffm
You may use this:
Code:
.form-horizontal label.control-label {
    text-align: left ;
}



Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 5 months ago by Joffm.
The following user(s) said Thank You: ch123
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose