SOLVED

SharePoint list Alternating column formatting

Copper 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 (Copper 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.

 

1 best response

Accepted Solutions
best response confirmed by Shinhidora (Copper 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.

View solution in original post