How to make each cell of Grid
being a square?
Style[Grid[Partition[ToUpperCase[Alphabet[][[1 ;; 25]]], 5],
Frame -> All, Alignment -> {Center, Center}], 40]
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityJus for curiosity (I was not aware of ItemSize->{1,1}
suggested by @Jean-Pierre) -
a brute force method :-D.
It depends on increment of i
, how precise you want to be. I chose 0.1
so probably not exact squares.
Clear[i]
grid=Style[Grid[Partition[ToUpperCase[Alphabet[][[1;;25]]],5],Frame->All,Alignment->{Center,Center},Spacings->{i,Automatic}],40];
i=0;
While[#[[1]]/#[[2]]&@ImageDimensions[Rasterize[grid]]<1,i=i+0.1]
i
grid
Clear[grid,i]
ItemSize->{1,1}
$\endgroup$