Skip to main content
edited tags
Link
Michael E2
  • 244.8k
  • 18
  • 351
  • 774
Tweeted twitter.com/StackMma/status/1022134461939560448
Source Link

Spanning horizontally and vertically in Grid

I'm trying to make a Grid that has one cell that spans horizontally and one that spans vertically, like so (generated manually with Graphics):

enter image description here

But when I try to do this with Grid, the right-most vertical cell doesn't span both rows:

Grid[{
    { Style["1", FontSize->30], SpanFromLeft, Style["4\n4", FontSize->30] },
    { Style["2", FontSize->30], Style["3", FontSize->30], SpanFromAbove }
}, Frame->All, Spacings->{3,3} ]

enter image description here

Since I have the frame active, I know the right-most cell does in fact span both rows, as we see if we remove SpanFromAbove:

Grid[{
    { Style["1", FontSize->30], SpanFromLeft, Style["4\n4", FontSize->30] },
    { Style["2", FontSize->30], Style["3", FontSize->30] }
}, Frame->All, Spacings->{3,3} ]

enter image description here

Is it not possible to combine vertical and horizontal spans in a grid? Is there a better function, like some combination of Column and Row? Thx