Hide table columns depend on button in multiple dynamic json array

Hide table columns depend on button in multiple dynamic json array,when we click on color button we need to hide color column.
I have created dynamic variable values in for loop,in myFunc trying to hide columns depend on variable status.