Forum Discussion
Column width resize in modern list
I am using modern list, and it is truly great, very well designed.
Anyway, I am using 6~7 columns, and "title" column's width is unnecessarily long, thus i have to scroll right to see entire columns.
I've tried resize title column's width and saved it, but when I go back and come again, width sizing is not saved.
Is there any way to save this resized width or setting defalut width of columns?
63 Replies
- jhallalCopper ContributorYes, you can adjust the width of columns in a SharePoint modern list and save the changes so that they persist when you navigate away and return to the list later. Here's how to do it:
- Click on the settings icon (gear icon) in the top-right corner of the list page and select "List settings".
- Scroll down to the "Columns" section and click on the column you want to resize.
- Under the "Column settings" section, click on the "Column width" option.
- In the "Column width" dialog box, enter a value for the desired width of the column (in pixels) and click "OK".
- Click "Save" at the bottom of the list settings page to save your changes.
Once you've saved the column width changes, they should persist and be applied every time you access the list. If you're still having trouble, try clearing your browser cache and refreshing the page to ensure that the changes have been properly applied.- KenJohnson2Brass ContributorI'm not sure how you are seeing "Column width" for your fields. We are not seeing that in the Column Settings. However, you gave good directions on how to get to where you can add JSON formatting to the column. So, this is a partial answer.
jhallal These is no Column Width option available under list settings > column settings page.
There are few new settings available to narrow/widen column like:
This narrow downs the Title column a bit. However, it cannot narrow down it completely because there are some hidden options like ellipses ( ... ), share and list comments options which will be shown when you hover over the list item.
Workaround (using SharePoint JSON column formatting): You can use JSON column formatting like below for your Title column:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "@currentField" }
After applying JSON column formatting, you can manually drag Title column width to narrow it down. Then save changes using Save view as option as mentioned in my answer here: SharePoint Modern List - Increase column width with JSON Issue
Note: This will allow you to narrow down the Title column width (see below image). However, you will loose SharePoint default option given in above image (ellipses context menu, share, list comments, etc).
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs
- KenJohnson2Brass ContributorThis seems like the best answer so far and the link you provided also covers how to drag the column width for Rich Text columns. Thanks for this post.
- ThePeopleCopper ContributorBUMP!
https://sharepoint.uservoice.com/forums/329214-sites-and-collaboration/suggestions/43399098-sharepoi...
It's not possible. I've been trying for ages. Vote at the site above to put an end to this.- UCalgaryCampbellCopper ContributorI can't believe there's still no solution to this. I went to vote on the issue and the site was deactivated.
- Jenny BruceIron Contributor
Have you tried formatting the column with custom JSON? The Microsoft 365 PnP Blog a nice introduction article about Modern SharePoint List Formatting
This doesn't specifically talk about setting column widths, but setting column widths using css in your JSON is among the many styling things you can do.- rmc2123Copper Contributor
My experience with the changing column widths using the JSON column formatter is that it changes the width of the text within the column, but not the width of the column itself. So if I set a column width for a description field to 500px, the default for other users would be a small column where the text was horizontally cut off until you dragged the column itself wider. Example of what I've tried that is still unsatisfactory below.
{"elmType": "div","txtContent": "@currentField","style": {"width": "500px"}}Still doesn't seem like there's a way for list/library web parts to have a persistent column width across users, which makes longer text fields look pretty terrible for users that haven't manually resized, no matter how you format the json (unless I'm missing another way of changing the actual column width in the json formatter).
- JaDeCopper Contributor2021 here and still no solution. I build custom SharePoint sites to manage my companies data. Every time I embed a SharePoint List the column sizes are all terrible. I can customize and save it for myself, but it only applies to me. When I am on Teams calls watching other users navigate my sites its very disappointing because the average user doesn't even know they can resize the columns. File names and Titles are always cut off. This is insane. If I save a view, at the very least it should be a public view that applies to everyone. Easy fix there, no need for JSON programming, but I'll take anything at this point.
- JonP2Copper ContributorThis is such an obvious feature. Please microsoft give us something so we can control this.
- DavidVsCopper Contributor
User Voice:
The long list of related user voice threads speaks about the user demand for a solution.
I would be grateful for some MS comment on this issue.
- AbhishekGargCopper Contributor
Not sure if you saw these posts recently. There is a way of resizing column widths and to make them stay across refreshes and sessions.
- Change width manually by dragging column divider as usual
- The view name in the 'view dropdown' shows a '*' next to it, meaning it is unsaved.
- Click the view dropdown -> 'Save view as'.
- Choose a new view name, or save using the same name for overwriting the current view.
From blog post:
https://blog.ciaops.com/2018/05/12/saving-custom-columns-widths-with-sharepoint-online/
As this post on UserVoice states, it is not very discoverable / intuitive though.
- Michael TippettCopper Contributor
AbhishekGarg It's been like this for a long time.
The issue is you cant reduce the size of the TITLE field smaller than a certain size.
- Deepak SinghCopper Contributor
A simple workaround, just in case someone hasn't discovered yet.
step1. Create another column, and name it similar to the title column you need, with a calculated value =[title column]
step2. In your required list view, exclude the original Title column and include this calculated column ordered at first place (as was the original title column)
step3. We can now change the title column width
- DavidVsCopper ContributorVery clever...
Thank you.
If I only new why every pain in Sharepoint has to be resolved through additional columns, why Microsoft can't make it work in the original column - Michael TippettCopper Contributor
not a good solution as you lose the (link to edit item)
I did use this solution with some fancy Json Formatting to kind of duplicate it, but it was a bit of a huge pain.
- Sophia JohnsonCopper Contributor
I was able to expand the column and "save view as" and it keeps the width. I can leave and go back to the list and it's still there. However I don't know how long it'll last. :-/
- Ryan RobinsonCopper Contributor
I tried a few different ideas before I saw Sophia's response here, simply resizing and then saving the view again. I had a coworker go look at it and it saved the width for him, too. Unless for some reason it gets lost over time, that seems to be pretty great. I never saw any announcements about this rolling out and neither did my coworker, but it definitely solves a problem for us.
It is only fixed width as far as I can tell. It would be possibly helpful in some scenarios if we could say "the width of the longest item in this column", but that's not a big deal.
Side note: I did try this JSON for a column:
{"elmType": "div","txtContent": "@currentField","style": {"width": "100%"}}That was nice on file name fields in that it would show the entire filename, broken down onto the next line if necessary, instead of it disappearing behind an ellipses. But the trade-off was losing the sharing button and link to open (you can still double-click the row to open), so it's still not as good as resizing the column and saving the view again.- SimonPCopper Contributor
For reasons unknown to me we don't have designer enabled on some of the sites I manage. The easiest way I have found to set column width is to use a combination of calculated fields and CSS; instead of displaying the field directly refer to the fields you want to display in a calculated field encapsulated in a <div>:
Note - for some reason I can only get this to work if I set the same CSS in a class and by id. I have no idea why, so it is not optional to use one or the other; you have to use both as below.
Calculated field formula:
=CONCATENATE("<div class='divName' id='divName'>,[Field to display],"</div>")
CSS
<style type='text/css'>
#divName{
width: 250px;
/* any other styling you wish */}
.divName{
width: 250px;
/* any other styling you wish */ }</style>
HTML to embed in a script editor web part somewhere on the page
<link href="address of css file" rel="stylesheet" type="text/css" media="all">
One of the other advantages of this is that you can easily change the width at any time by editing the css - I guess you could also just add style='width: nnnpx;' somewhere within the calculated div formula itself, but the above is the way I do it.
The main downside of this is it will not easily work for people or Rich text fields where other workarounds are required to get the to work in a calculated field in the first place.
Now if someone can tell me why have to set the css twice for it to work it would be great!
- Jenny BruceIron Contributor
In my tenant, it column width still doesn't stick when list is embedded on a page, even when a specific view is made for embedding. From what I understand (preview) in the web part name means Microsoft are still working on this web part. Can't recall seeing this web part mentioned in the Roadmap, so hard to know when something will be done.
- Matthew JonesBrass Contributor
Dear Microsoft,
Please could you provide an update to this topic. It has been nearly 2 years now and there has been no feedback.
Thank you,
Matt
- Nicholas Byng-MaddickBrass Contributor
I believe that this has been resolved as I noticed a recent change in behaviour . Drag column to desired width and save view . This then appears to stick across different browsers as well .
- Joseph LiskaCopper Contributor
Title Column still cannot be edited at all.
Widths do save if you're accessing the list itself but I, and I assume many others, are going to be using the List (Preview) to embed it on a page. This is not editable and saved views do not include column widths.
Not even close to resolved.
- Cy MarvenBrass Contributor
Well, just a about a year I think and still nothing. Some elaborate work arounds but really? I would like to just be able to set the width as an attribute when I set up the column. Not only do I not code but I want users to take control of their own lists. Are all 400+ members of my organisation to learn Java or CSS?
- Michael TippettCopper Contributor
100% agree, looking forward to a proper solution
- Rachael PrestonCopper Contributor
I doubt Microsoft cares enough to resolve this issue. They haven't even fixed ongoing issues that sprung up over a decade ago.
I'm expecting them to wait until enough clients move over to their online SharePoint services at which point they'll decide to discontinue providing it.
- Joseph LiskaCopper Contributor
I agree with almost everyone in this thread. This is making Sharepoint Online with Modern Views an extremely tough sell to anyone I'm trying to onboard.
This is just one of a multitude of items that cannot be edited. I understand that reducing end user options makes for a more affordable product, easier to scale, easier to upgrade etc but this is bordering ridiculous.
Let's see those teams working towards functionality that should have been present out of the box.
- Michael TippettCopper Contributor
Why does Microsoft insist on taking 1 step forward and 2 steps back. Modern style is great, except there is no ability to customize which is stupid.
Then they make the title column wide for some reason without the ability to change it.
I give 1 Vote to fix this, easiest way, and best way, give us back access to the CSS!
In saying that, I've found a (annoying) workaround.
Create a Calculated Column, make the value equal the Title value. Then update the JSON FORMATTER to make it a link if required.
Then hide the title in the view and show the calculated one in its place.
now the kicker, I couldnt figure out how to get the ID in the JSON Formatter, so I had to make a middle redirect page, which translated the Title into an ID and forwarded it to the correct place. (this step is only required if you need the title to link to edit the list item)
- Michael TippettCopper Contributorjust with the above, I managed to hack a way to get id as well..
There maybe a better way (I really hope there is) but I made ANOTHER calculated field, and made it =Id I called this IdCopy, then in the json formatter where I set the link i did this:
{
"debugMode": true,
"elmType": "a",
"attributes": {
"target": "_self",
"href": {
"operator": "+",
"operands": [
"/SitePages/JobDetaildev.aspx?JobCode=",
"[$IdCopy]"
]
}
},
"txtContent": "@currentField"
}
ALOT of UGLY work just to get it to stop taking up a set width.