Aug 19
2
Previously, I wrote about how to adjust the column width of a list in SharePoint 2010. However, none of that advice works in SharePoint Online. There is a ton of crazy information out on the web and most all of it is useless. I found this one suggestion by Vadivelu B. on a Microsoft forum to be just what I needed.
I suggest saving the below code to a text file, putting that text file in your site collection SiteAssets folder, and then it will be available for you to simply call from a Content Editor Web Part (CEWP) that you add to any list page.
For this code, DisplayName is the column name. In the below example, this script sets the Comments column to 400 px. So obviously edit it for your situation.
<style type='text/css'> .ms-vh-div[DisplayName='Comments'] { width: 400px; } </style>