0

I am currently working on developing a List in Sharepoint. The top headers are quite long in length and I am trying to format the text so it takes up less space, such as wrapping? I have attached a picture below to try and orchestrate my list.

Ex. ABC XYZ vs

ABC

XYZ

Any ideas to accomplish this task? Thanks! enter image description here

2 Answers 2

0

You can use the below css to adjust the width between columns :

SharePoint Online

You can use the below JSON to format the column :

{
“$schema”: “https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json”,
“elmType”: “div”,
“txtContent”: “@currentField”,
“style”: {
“width”: “100%”,
“white-space”: “nowrap”
}
}

For details refer to the below article :

How to change column width of a List in Sharepoint Online?

Sharepoint On-Premise :

<style>
 table.ms-listviewtable tr:first-child td +td+td+td+td   

 { 
    width:187px;
    }
    table.ms-listviewtable { width:587px; }    </style>

And also you can open the site in SharePoint designer and follow the below steps :

Open your view/AllItems.aspx in SharePoint Designer.

Get cursor to your column in design mode and drag it to desired width you want.

Delete Nowrap=’Nowrap’ for this column and add below highlighted style.

For details information about the above refer to the below article :

Change the space between columns. 

0

If you are referring to the column name length, I’m afraid it is not supported to format column headers to accept text wrapping, since modern experience doesn’t accept customization with master page.

Column formatting JSON is a doable workaround. It doesn’t wrap texts in column headers, but it fixes the column width to the same for longer column headers.

In fact, we can manually adjust column width by dragging the boundary line between column headers.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.