I always thought that Grid
(and the underlying GridBox
) and the general handling of tabular objects is a bit weird in Mathematica. One particularly annoying fact is that while one can set column widths explictly, the same cannot be done to row heights, because each row is set to the height of its largest content by default. I don't really understand this asymmetry between the two dimensions. Does anyone have any insight on this matter?
As a more specific question: How to set the row height to be exactly 1, by clipping the content if necessary (i.e. some part of it should not be visible)?
Grid[{
{"000000000\n111111111\n222222222", "000000000"},
{"000000000", "000000000"}
},
ItemSize -> {{10, 5}, {1, 1}}, Frame -> All]
Can this be done with only Grid
or do I have to map a Pane
with explicit height value to each element (converting from pixels to ems, as Pane
uses the latter)?
ItemSize
is explained (the third example of Scope section: it sets minimal height, not fixed height) but I agree that it is not entirely consistent or desirable behavior (I do not know the rationale behind this design...). $\endgroup$Grid[{{Item[Rotate["this is a long test example", Pi/2],ItemSize -> {3, 50}]}}, Frame -> True]
. I know that you probably can't answer to this comment, but I would like to express my frustration. $\endgroup$