Forum Discussion
Shinhidora
Dec 23, 2020Copper Contributor
SharePoint list Alternating column formatting
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.
Shinhidora Nope. If you have formatting you want applied to each column, you would need to add the formatter JSON to each column.
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','')" }
Reference: Alternate 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.
Shinhidora Nope. If you have formatting you want applied to each column, you would need to add the formatter JSON to each column.