Increase SharePoint 2019 column width with JSON

Copper Contributor

Is it possible to use JSON to increase the width of a document library column?  If so, can you please share an example of that JSON?  I'm trying to solve the problem of when a document library is added to a page, the title column doesn't display the full title, and users are not seeing how to expand the width of the column themselves.  I'd like to increase the width of the title column.

2 Replies

Hi @MichelleARC,

 

Certainly, here's a simplified explanation:

In SharePoint 2019, you can make the "Title" column wider by using a special code in JSON format. This is helpful if you want the full title to be visible without users needing to manually adjust the column width.

Here's an example of how you can do it:

 

 

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "style": {
    "width": "300px"  // You can change this to make the column wider
  },
  "children": [
    {
      "elmType": "a",
      "txtContent": "@currentField",
      "attributes": {
        "href": "[$FileDirRef]/@currentField"  // Adjust as needed
      }
    }
  ]
}

 

 

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.


Kindest regards,


Leon Pavesic
(LinkedIn)

Thanks for the reply! When I add the code to the Title column, it doesn't save in the column. When I go back to view the column settings, the Json field is empty.