Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
How to wrap long column headers (labels) in a list view - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • How to wrap long column headers (labels) in a list view
KB0786159

How to wrap long column headers (labels) in a list view


3214 Views Last updated : Apr 8, 2025 public Copy Permalink
KB Summary by Now Assist

Issue

This article is meant to provide a way in which to overcome long column labels in lists when wrapping of the field label would be preferred.

 

NOTE: THIS IS A COMPLETELY UNSUPPORTED EXAMPLE SCRIPT AND IS PROVIDED AS IS.  PLEASE DO NOT CONTACT CUSTOMER SUPPORT FOR ASSISTANCE WITH THIS ARTICLE OR EXAMPLE. 

 

Starting point:  Open_at field on the incident table has a very long label in the dictionary, as shown below:

example of long text on field

 

Results after using this unsupported UI Script (detailed within this article)

Example of the text wrapping down on the column

Release

All current releases

Cause

Very long field labels in the dictionary, which can not be easily made to wrap within the list.

Resolution

There is no current OOB mechanism to allow for the wrapping of long column labels. 

The below unsupported UI Script should work to resolve the display formatting limitation of the field label when viewed in the list.  

NOTE: THIS EXAMPLE UI SCRIPT IS NOT SUITABLE FOR RELATED LISTS AS SHOWN BELOW

~~~snip~~~
(function(){
// Just run on incident list pages
if ( !~location.href.indexOf( 'incident_list.do' ))
return;

var styles = [
'#hdr_incident > th[glide_field="incident.opened_at"] { max-width:75px; }',
'#hdr_incident > th[glide_field="incident.opened_at"] > span:nth-child(1) { white-space:pre-line !important; }',
'#hdr_incident > th[glide_field="incident.opened_at"] > span:nth-child(1) > a[data-type="list2_hdrcell"] { white-space:inherit; }'
].join(' '),

link = document.createElement( 'link' );
link.type = 'text/css';
link.rel = 'stylesheet';
link.href = URL.createObjectURL( new Blob([ styles ], { type: 'text/css' }) );

(document.head || document.documentElement).appendChild( link );
})();

~~~/snip~~~


NOTE: Modify this as the example is column specific (here, the dictionary entry for the opened_at field label was very long)

 

A screenshot of the example script:

example of the CSS script record

Related Links

While mentioned several times above, it's worth saying again:

This example UI script is not supported or endorsed by ServiceNow.  Use this example script at your own risk.


The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.