Default text-alignment for server-side numbers (integer, decimal, price)

LG12
Kilo Explorer

Hi,

My question is: how do I enforce all the int/decimal in ServiceNow server-side tables and fields to align left?

I noticed all the input fields of type number (int, decimal…) in ServiceNow server-sides are aligned to the right, while the text fields are aligned to the left.

When inspecting the page, the Variables table cells had a class-name of “vt”, while the Configuration fields were of class “decimal form-control”.

The cells under Order were of class “vt” and had their style specifically set to “text-align: right”, while the cells under Question, Field and Type did not have their style specified:

 find_real_file.png

find_real_file.png

 

 

 

The “decimal form-control” class was only for decimal numbers, and not for other input types:

 find_real_file.png

find_real_file.png

 

Could you please help me to find out me where “vt” elements get their styling from, and how I can enforce all the numbers of both classes to align to the left?

Many thanks!

1 ACCEPTED SOLUTION

AbhishekGardade
Giga Sage

Hello LG,

I have same requirement but for another table: Check out the below screenshots,

1. right click between column, click on configure ALL.

find_real_file.png

2.  Go to Styles and click on new as below:

find_real_file.png

3. Create new style as below:

find_real_file.png

Please mark answer as Correct if you found it as helpful.

Thanks,

Abhishek Gardade

Thank you,
Abhishek Gardade

View solution in original post

6 REPLIES 6

Hi Abhishek,

 

Thank you for your reply.

I want to change it for all the number fields in all the tables in ServiceNow, as we will never want them aligned to the right (such as we won't want the String fields aligned to the right. I just don't find the sense why ServiceNow made it the default style in the first place).

Fix scripts sounds like a good idea. How do I access a table's properties using server script? GlideRecord returns the records themselves and not the properties (such as the Order property and its style) and document.getElementById() only works in client side?

 

Thank you!

I see this solution all over, however it does not appear to work on read only fields. I've seen a few posts, but so far no answer. 

Any thoughts?