After running the code, the rows and columns in the grid are not aligned. How can I set them to align properly?
{a = m, b = n, c = s, d = t}
Flatten[MapThread[{#1 == #2 // Simplify} &, {{"a+b", "ab", "c+d", "cd",
"ac+bd", "ad+bc"}, {a + b, a b, c + d, c d, a c + b d,
a d + b c}}], 1];
% // Partition[#, UpTo@4] & // Grid
Grid has an Alignment option. You didn’t specify what alignment you wanted. Aligning horizontally as left, center, or right is simple. If you want to align on the “==”, then you’ll need to create your expressions differently. You code creates expressions that are a mix of strings and symbols, and I don’t think Alignment can “look into” such expressions to find the marker to align on. I would approach it as follows:
expressions = {a + b, a b, c + d, c d, a c + b d, a d + b c};
equations = MapThread[Row[{##}, "="] &, {expressions, expressions /. {a -> m, b -> n, c -> s, d -> 999}}];
(* I used 999 to exaggerate the non-alignment you'd see without using the Alignment option *)
Grid[Partition[equations, UpTo[4]]]