6
$\begingroup$

I would like to Align several distinct boxes so that the top of each one is at the same level. For example:

framed1 := Framed["", ImageSize -> {100, 100}]
framed2 := Framed["", ImageSize -> {250, 75}]
framed3 := Framed["", ImageSize -> {50, 50}]

Row[{framed1, framed2, framed3}, "   "]

enter image description here

Ideally, all three boxes should have their top line begin at the same place as the first one, instead of being centered.

$\endgroup$
  • 1
    $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – Young Jul 12 '16 at 1:57
  • $\begingroup$ People here generally like users to post code as Mathematica code instead of images or TeX, so they can copy-paste it. It makes it convenient for them and more likely you will get someone to help you. You may find this this meta Q&A helpful $\endgroup$ – Michael E2 Jul 12 '16 at 2:46
6
$\begingroup$

Use BaselinePosition

framed1 := Framed["", ImageSize -> {100, 100}, BaselinePosition -> Top]
framed2 := Framed["", ImageSize -> {250, 75}, BaselinePosition -> Top]
framed3 := Framed["", ImageSize -> {50, 50}, BaselinePosition -> Top]

Row[{framed1, framed2, framed3}, "   "]

enter image description here

It may help to review the other Framed options.

$\endgroup$
5
$\begingroup$

One may also find Grid useful:

framed1 := Framed["", ImageSize -> {100, 100}]
framed2 := Framed["", ImageSize -> {250, 75}]
framed3 := Framed["", ImageSize -> {50, 50}]

Grid[{{framed1, framed2, framed3}}, Alignment -> Top]

enter image description here

If a special separator is needed it can be Riffle'd in:

Grid[{{framed1, framed2, framed3} ~Riffle~ "⊙"}, Alignment -> Top]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.