The code you posted have many issues. May be it was a cut/paste problem. Also important to know the difference between =
vs. :=
. Also avoid UpperCaseSymbols and function names in Mathematica. They can conflict with Mathematica own symbols.
I think what you want is
ClearAll[i, k];
z = Last@Reap@Table[If[OddQ[n], Sow[n i], Sow[n k]], {n, 1, 12}]
(*{{i, 2 k, 3 i, 4 k, 5 i, 6 k, 7 i, 8 k, 9 i, 10 k, 11 i, 12 k}}*)
Or you can Sow
the If
itself
z = Last@Reap@Table[Sow@If[OddQ[n], n i, n k], {n, 1, 12}]