Thanks, for providing a answer.
However, I can't get to work.
The categorical binary variables in my dataset, I wan't to apply this to, is in the rows (e.g. hypertension yes/no, smoking yes/no, x-ray yes/no etc.), not the columns (here I have group 1 and group 2).
I tried to recode the variables beforehand omitting the "no's=0). However, then the percentages will get wrong (all will off course be 100%).