Is there a way to extend the file name column width in Doc Library Webpart on SharePoint Online modern page? RRS feed

  • Question

  • The Document Library webpart on modern page has very narrow file name column width when displayed by default, leaving most right area blank in the webpart.  Although users can manually extend the width by pulling the edge of the column, but that only works for that user, besides most user may not know they can do that.

    Is there a way to set the width wider be default so all users can see complete file name?

    Thanks for any tips!

    Thursday, February 13, 2020 6:10 PM

All replies

  • Hi, QuickLaunch,

    Here are two options for you to choose. However, neither of them are perfect solution for your requirements. Have a try and see which works for you better.

    1. Customize column width and save it with a view. 

    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.

    The document library web part will inherit the custom settings of view. After you change the column width and save it in a certain view. You can use that view in a library web part and have the same column width applied

    Pros: It is an OOB approach and have no impact on daily use. Easy to apply. 

    Cons: Considering personal preference, this settings is saved in user level.  The column width can be saved as part of the view and each user’s preference will be saved in local storage. So we have no option for an admin to change it and apply the settings to every user. End users will need to change it according to their requirements. Admin need to perform some training for end users. 

    2. Use JSON formatting.

    Go to your library and click on the column header, then Column settings > Format this column. Paste the code into the text box in your right hand

      "$schema": "",
      "elmType": "div",
      "txtContent": "@currentField",
      "style": {
        "width": "100%"

    Pros: Admin can apply the settings to that column and all the users will directly see the new column. No need for end users to do anything.

    Cons: Ellipsis and share button will be hided due the way JSON formatting is applied. It may have impact on daily usage.

    More information about JSON Formatting: 

    Discussion on this request:

    You can vote in UserVoice for more attention.

    Best Regards


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    • Proposed as answer by VSP-- Friday, February 14, 2020 6:56 AM
    Friday, February 14, 2020 2:57 AM
  • Thanks for the tips.

    I see both options have problems, I also tried JSON, it won't work as it breaks ellipsis and names become grey.

    Of the two, I may have to use #1.  Actually, I don't need to save views, once I extended the column width, it will remain that way next time, it is cached I guess.

    I will put my voice in.

    Friday, February 14, 2020 3:47 PM