# Column (and Grid) Alignment Changes with OpenerView

Column does not maintain Alignment settings when OpenerView opens and closes.

Column[{Graphics[{Blue, Rectangle[{0, 0}, {1, .25}]},
ImageSize -> Small],
Sequence @@ ConstantArray[
OpenerView[{"Text and Stuff wider than the graphic",
"Wide grid of numbers and a lot of stuff and the like."}, False],
3]},
Alignment -> {{Center, {Left}}, Automatic}]


The above Column displays as expected. The first row is centred and the remaining rows are aligned to the left. However, look at what happens if I open a one of the OpenerView items.

The rows that should be aligned to the left change their alignment to centre. The behaviour is:

• All OpenerViews closed then they are correctly aligned to the left.
• Any OpenerView open is aligned to the left but those closed are aligned center.

Have I spec'd Alignment incorrectly or is this a bug?

Adding that the same happens with Grid.

Grid[{{Graphics[{Blue, Rectangle[{0, 0}, {1, .25}]},
ImageSize -> Small]},
Sequence @@ ConstantArray[
OpenerView[{"Text and Stuff wider than the graphic",
"Wide grid of numbers and a lot of stuff and the like."}, False],
{3, 1}]},
Alignment -> {{Center, {Left}}, Automatic}]

• Try OpenerView[..., ImageSize->All]. Then it won't jump around. – Jack LaVigne Sep 14 '15 at 23:29
• @JackLaVigne That was the ticket. I need to use ImageSize -> {All, Automatic} instead of just ImageSize -> All as the hidden grid is tall. Post this as an answer. – Edmund Sep 14 '15 at 23:46

The documentation says that for OpenerView the option ImageSize -> Automatic instructs it to only leave space for the expressions that are in view.

With ImageSize -> All it will leave space for the largest expression.

Column[{
Graphics[{Blue, Rectangle[{0, 0}, {1, .25}]}, ImageSize -> Small],
Sequence @@ ConstantArray[
OpenerView[{
"Text and Stuff wider than the graphic",
"Wide grid of numbers and a lot of stuff and the like."
},
False,
ImageSize -> All],
3
]},
Alignment -> {{Center, {Left}}, Automatic}
]


This gives a column that looks like this with the first element open:

If you want to control the width and height independently you can use:

Grid[{
{Graphics[{Blue, Rectangle[{0, 0}, {1, .25}]}, ImageSize -> Small]},
Sequence @@ ConstantArray[
OpenerView[
{
"Text and Stuff wider than the graphic",
"Wide grid of numbers and a lot of stuff and the like."
},
False,
ImageSize -> {All, Automatic}
],
{3, 1}
]},
Alignment -> {{Center, {Left}}, Automatic}
]


Here the width is the width of the maximum width of all of the components but the height will only display what is required to display what is on the screen.

• This helped. I've gone with ImageSize -> {All, Automatic} instead as the hidden grid is very tall. – Edmund Sep 16 '15 at 23:51