Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

This grid works:

Grid[Table[Append[ConstantArray[1, 5],
If[i === 1, Button["", 0;, ImageSize -> {30, 315}], SpanFromAbove]],
{i, 20}], Alignment -> {Center, Center}, Frame -> All]

I want the first row to be one single place, except for the button, but when I do it, it gets crap:

Grid[Table[Append[If[i === 1, Prepend[ConstantArray[SpanFromLeft, 4], 1], ConstantArray[1, 5]],
If[i === 1, Button["", 0;, ImageSize -> {30, 300}], SpanFromAbove]],
{i, 20}], Alignment -> {Center, Center}, Frame -> All]

What can I do to the second piece of code to make the button align like it did the first time?

share|improve this question

marked as duplicate by Mr.Wizard Oct 8 '14 at 17:05

This question was marked as an exact duplicate of an existing question.

ImageSize -> {30, Full} helps a bit but does not solve the problem. – Alexey Popkov Aug 9 '14 at 15:32
I think this is a duplicate of my own report: (13349) -- please take a look and tell me if you disagree. – Mr.Wizard Aug 9 '14 at 23:54

Would it be acceptable for you to combine the grid and the button using Row?

In[129]:= Framed[Row[{Grid[Table[ConstantArray[1, 5], {20}], Frame ->All],
Spacer[2],Button["", 0;, ImageSize -> {30, 315}]}], FrameMargins -> 0]

This may give you more flexibility in layout options.

share|improve this answer

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