Can i set column width for all views

%3CLINGO-SUB%20id%3D%22lingo-sub-1783074%22%20slang%3D%22en-US%22%3ECan%20i%20set%20column%20width%20for%20all%20views%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1783074%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20i've%20got%20a%20lot%20of%20views%20from%20a%20library%20and%20want%20to%20set%20the%20column%20width%20to%20all%20the%20file%20name%20is%20viewed%2C%20not%20just%20the%20first%20few%20words...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'v%20been%20playing%20with%20JSON%20but%20don't%20have%20a%20clue%20really..%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20managed%20to%20wrap%20the%20text%20to%20make%20it%20easier%20to%20view%20but%20it's%20still%20defaulting%20to%20a%20narrow%20column.%20Any%20ideas%20how%20to%20make%20it%20as%20wide%20as%20the%20longest%20file%20name%20or%20just%20a%20set%20width%3F%3F%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%7B%0A%20%20%22%24schema%22%3A%20%22https%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fcolumn-formatting.schema.json%22%2C%0A%20%20%22elmType%22%3A%20%22div%22%2C%0A%20%20%22txtContent%22%3A%20%22%40currentField%22%2C%0A%20%20%22style%22%3A%20%7B%0A%20%20%20%20%22white-space%22%3A%20%22normal%22%2C%0A%20%20%20%20%22padding%22%3A%20%2210px%200%22%0A%20%20%7D%2C%0A%20%20%22attributes%22%3A%20%7B%0A%20%20%20%20%22class%22%3A%20%22ms-fontColor-themePrimary%22%0A%20%20%7D%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1783074%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDocument%20Library%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
New Contributor

Hi, i've got a lot of views from a library and want to set the column width to all the file name is viewed, not just the first few words...

 

I'v been playing with JSON but don't have a clue really..

 

 

I've managed to wrap the text to make it easier to view but it's still defaulting to a narrow column. Any ideas how to make it as wide as the longest file name or just a set width??

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
  "elmType": "div",
  "txtContent": "@currentField",
  "style": {
    "white-space": "normal",
    "padding": "10px 0"
  },
  "attributes": {
    "class": "ms-fontColor-themePrimary"
  }
}

 

0 Replies