How to align Row [] elements with bottom or top in Mathematica?
When I write
Row[ { Framed@Column [{1,2}], Framed@ "123"}, Alignment->Top]
or
Row[ { Framed@Column [{1,2}], Framed@ "123"}, Alignment->{Left,Top}]
in any case, nothing happens. The default alignment is the center, and the elements are listed according to the environment.
Grid[ {{ Framed@Column [{1,2}], Framed@ "123"}}, Alignment->Top]
works just fine, but Grid[]
is redundant when Row[]
enough.
The help system says that alignment should work (the {Left,Baseline}
list as an example), but it doesn't seem to be mutable. I am using v8.0.4.
The Alignment
parameter in Row
does not align individual elements on their own, but rather these elements in an external bounding box. This can be seen with
Framed@Row [{ Framed@Column [{1, 2}], Framed@ "123"}, ImageSize -> {150, 150}, Alignment -> {Left, Top}]
Framed@Row [{ Framed@Column [{1, 2}], Framed@ "123"}, ImageSize -> {150, 150}, Alignment -> {Center, Bottom}]
Use a Grid
instead.
As Mr.Wizard Grid
said, probably your best bet, but if you want to use Row
, you can do something like
Row[Pane[#, BaselinePosition -> Top] & /@ { Framed@Column [{1, 2}], Framed@ "123"}]
Note that Framed
also has a BaselinePosition
option, so for this specific example, you can also do something like
Row[Framed[#, BaselinePosition -> Top] & /@ {Column[{1, 2}], "123"}]
but Pane
works anyway.