Modern SharePoint List - Column Width

Williams, Kim (US) 126 Reputation points
2023-01-05T13:17:57.27+00:00

I'm using JSON code to set a Multiple Line Text Column's width for everyone to be able to see and not just for me. JSON works for coloring the columns and all can see, why doesn't the width work?

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,736 questions
0 comments No comments
{count} votes

Accepted answer
  1. AllenXu-MSFT 16,256 Reputation points Microsoft Vendor
    2023-01-11T08:23:21.6466667+00:00

    @Williams, Kim (US) ,

    Thanks for your reply. Maybe you can take this method as an alternative into consideration. Hide column header using the syntax hideColumnHeader and create custom column header using JSON. See this demo:

    [https://learn.microsoft.com/en-us/answers/questions/591263/fixed-column-header-width-in-lists .


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


4 additional answers

Sort by: Most helpful
  1. AllenXu-MSFT 16,256 Reputation points Microsoft Vendor
    2023-01-06T01:38:15.047+00:00

    Hi @Williams, Kim (US) ,

    Here is a sample how I format the width of the column using JSON, just set the width attribute like below:

    {  
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",  
      "elmType": "div",   
     "style": {  
        "width": "80%"  
      },  
      "txtContent": "@currentField"  
    }  
    

    276714-image.png

    Also you can post your code here if anything unclear.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

  2. Williams, Kim (US) 126 Reputation points
    2023-01-09T13:02:17.947+00:00

    @Allen Xu_MSFT

    Yes, I am aware of that but didn't want to have to tell all the users, they need to do this (some will not want to and expect it to be full width). I want to set it so users do not have to drag the column.

    0 comments No comments

  3. AllenXu-MSFT 16,256 Reputation points Microsoft Vendor
    2023-01-10T01:58:58.41+00:00

    @Williams, Kim (US) ,

    Each user will be able to set a custom header width for each column in a view, and have those settings persist for multiple sessions. This is by design and I'm afraid currently there is no alternative way to achieve your need. You can submit your feedback to MS here: https://feedbackportal.microsoft.com/feedback/forum/06735c62-321c-ec11-b6e7-0022481f8472. Customer feedback is very important to us – your ideas can change and improve products for users around the world.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  4. Williams, Kim (US) 126 Reputation points
    2023-01-10T14:33:06.693+00:00

    @Allen Xu_MSFT Thank you for your response. I guess I was somewhat confused, since as an Admin of a Site or List, I can set the Column color or Row Color for all users, but not the width. Currently the solution that my team wants to use for some list is to keep it in Classic Mode, which to me is not ideal.

    0 comments No comments