Adjust the column width on a webpart

Diana Weaver 120 Reputation points
2023-08-31T13:09:30.7933333+00:00

Is there a way to modify an individual column width in a webpart display of a list?

User's image

We are trying to increase the title column and decrease the URL column.

Diana

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

1 answer

Sort by: Most helpful
  1. Emily Du-MSFT 34,106 Reputation points Microsoft Vendor
    2023-09-01T02:05:09.8833333+00:00

    Here is an example for you:

    1.Click Edit page in the Settings gear.

    2.Add a web part, choose Script Editor web part.

    3.Edit web part, then click EDIT SNIPPET, add following codes. Note: You should replace the column display name with your own.

    <style>
    .ms-vh-div[DisplayName='custom']
    {
        width : 700px !important;
    }
    </style>
    

    4.Result:

    1


    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.