When I execute this
Grid[{{x, x}, {SpanFromAbove, x}, {SpanFromAbove, x}},
ItemSize -> {{Automatic},
{Automatic, {1 -> Scaled[0.2], 2 -> Scaled[0.4], 3 -> Scaled[0.4]}}},
Frame -> All,
Alignment -> {Center, Center}, Spacings -> {{2}, {1}}]
I get an extremely tall grid instead of a normal height grid. Is this a bug or am I doing something wrong? Version 10.0.1 Win8.1 64bit
This just keeps getting worse. I am have used a Pane
as some have suggested that the grid needs a sized container for it to work with Scaled
. I get back a truncated grid. This is really baffling. Any ideas how to get this to work.
Pane[
Grid[{{x, x}, {SpanFromAbove, x}, {SpanFromAbove, x}},
ItemSize -> {{{Scaled[0.5]}},
{Automatic, {1 -> Scaled[0.2], 2 -> Scaled[0.4], 3 -> Scaled[0.4]}}},
Frame -> All, Alignment -> {Center, Center}, Spacings -> {{1}, {1}}],
ImageSize -> {432, 216}]
It gives a cut off grid. ??? I can just make out the top of the "x" in the first column. It shouldn't be this difficult to have a grid a prescribed size and scale some rows within it. I must be doing something wrong.
Answer
My advice, unless it is really basic problem, do not use SpanFrom~
. Usually you will face "issues" like that. Next time try with nested Grids
.
Like I've said, the whole layout management is broken and everyone who tried do something more complex than simple grid with automatic options will agree.
This is just another example, your case works if vertical heights sum up to: .5
...
Framed[
Grid[{
{x, x},
{SpanFromAbove, x},
{SpanFromAbove, x}},
ItemSize -> {
{{Scaled@.499}}, (*specX*)
{Scaled@.1, Scaled@.2, Scaled@.2} (*specY*)
}, Frame -> All, Alignment -> {Center, Center}, Spacings -> {0, 0}]
,
ImageSize -> {432, 216}, FrameMargins -> 0, Alignment -> {Left, Top}]
Comments
Post a Comment