Forum Discussion
Joe Fischer
Aug 27, 2018Brass Contributor
SPO modern list column width
Hi All, I am on SPO and my modern lists will not resize the columns based on the the content. All my column names are longer than the width of the column, and you have to maually expand each column...
davidpetree1
Aug 27, 2018Iron Contributor
Sure, There is a way you can change the width with code.
If you have the admin rights to do it, you could, but you are correct, Microsoft could release an update and it could overwrite your code.
Its just something you have to determine if its worth it or not.
Joe Fischer
Aug 27, 2018Brass Contributor
Hi David,
Would you happen to have a link to some sample code?
Do you know if the code would be for a site collection, or per list?
If it's per list I can pick and choose more import lists and keep my finger crossed :)
Thanks again,
Joe
- davidpetree1Aug 27, 2018Iron ContributorI do not, but google has a ton of different articles with different codes. I would say see which one works for you. I found Js Scripts & CSS scripts. Just depends on which one you feel more comfortable with.
- Aug 27, 2018AFAIK, the only way to customize columns width in a modern list is by means of the JSON formating but I don't recall seeing this use case. JSON formatting is awesome to change how the list looks like so it should be technically possible. JSON formatting is available at two scopes:
(1) List coulumn.
(2) List view (Coming in september)