SOLVED

SharePoint list Alternating column formatting

%3CLINGO-SUB%20id%3D%22lingo-sub-2012389%22%20slang%3D%22en-US%22%3ESharePoint%20list%20Alternating%20column%20formatting%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2012389%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20everyone%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20was%20wondering%20if%20it%20is%20possible%20to%20alternate%20the%20background%20color%20of%20colums%20using%20JSON%20formatting%20on%20a%20Sharepoint%20List%20view%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20aware%20of%20the%20conditional%20formatting%20and%20setting%20the%20formatting%20for%20each%20column%20manually.%20But%20is%20it%20possible%20to%20set%20alternating%20column%20colors%20like%20how%20you%20are%20able%20to%20set%20row%20formatting%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2012389%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormatting%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EJson%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ELists%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2012420%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20list%20Alternating%20column%20formatting%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2012420%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F709875%22%20target%3D%22_blank%22%3E%40Shinhidora%3C%2FA%3E%26nbsp%3BNope.%20If%20you%20have%20formatting%20you%20want%20applied%20to%20each%20column%2C%20you%20would%20need%20to%20add%20the%20formatter%20JSON%20to%20each%20column.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hello everyone,

 

I was wondering if it is possible to alternate the background color of colums using JSON formatting on a Sharepoint List view?

 

I'm aware of the conditional formatting and setting the formatting for each column manually. But is it possible to set alternating column colors like how you are able to set row formatting? 

 

Thank you.

2 Replies
best response confirmed by Shinhidora (New Contributor)
Solution

@Shinhidora Nope. If you have formatting you want applied to each column, you would need to add the formatter JSON to each column.

@Shinhidora 

 

I don't think it is possible to set background-color to alternate columns.

 

However, if you are looking for setting background color to alternate rows then you can do it like below:

 

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
  "additionalRowClass": "=if(@rowIndex%2==0,'ms-bgColor-themeLight','')"
}

 

 

ReferenceAlternate Row Formatting based on Modulus 


Please click Mark as Best Response 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.