Bug introduced in 7.0 or earlier and persisting through 11.0 or later. Fixed in 13.0.0 or earlier
I have run into another problem with Grid
today.
An explicitly specified ItemSize
is being ignored:
dot = Graphics[{Pink, Disk[]}, ImageSize -> 40];
tab = {{"Type", "Name", \[SpanFromLeft], \[SpanFromLeft],
Item[dot, ItemSize -> 2.7],
Item["Esculap",
Alignment ->
Left], \[SpanFromLeft], \[SpanFromLeft]}, {\[SpanFromAbove],
"Dia.", "Spec", \[SpanFromLeft], \[SpanFromAbove],
Item[8.3 "mm", ItemSize -> {3.5, 2.7}, Alignment -> Right],
Item[11, Alignment -> Right], "6.3"}, {Item[dot, ItemSize -> 2.7],
Item["Flycatcher",
Alignment -> Left], \[SpanFromLeft], \[SpanFromLeft],
Item[dot, ItemSize -> 2.7],
Item["Apus",
Alignment ->
Left], \[SpanFromLeft], \[SpanFromLeft]}, {\[SpanFromAbove],
Item[6.9 "mm", ItemSize -> {3.5, 2.7}, Alignment -> Right],
Item[17, Alignment -> Right], "9.8", \[SpanFromAbove],
Item[7.8 "mm", ItemSize -> {3.5, 2.7}, Alignment -> Right],
Item[8, Alignment -> Right], "6.7"}};
Grid[tab,
Spacings -> {Automatic, {{0, -1.1}}},
Alignment -> {Center, Center},
Dividers -> All
]
Please note Item[8.3 "mm", ItemSize -> {3.5, 2.7}, Alignment -> Right]
where a vertical ItemSize is explicitly specified, yet it is ignored in the layout.
If the "Spec" cell is not spanned this does not happen:
tab[[2, 4]] = "X";
Grid[tab,
Spacings -> {Automatic, {{0, -1.1}}},
Alignment -> {Center, Center},
Dividers -> All
]
Is this another bug in
Grid
?Is it still present in version 8?
How can I best work around it?
Grid
with spanned cells and I must say I'm finding it an aggravating experience. $\endgroup$ItemSize
is causing the problem? Would something like "Grid -- nested spanning causing problem" be better? $\endgroup$ItemSize
is being ignored. If you leave outItemSize
then the bottom (twin) row looks like the top one. I was trying to keep the title distinct from this one. $\endgroup$