MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Grid[] problems with SpanFrom...

  • To: mathgroup at smc.vnet.net
  • Subject: [mg94111] Grid[] problems with SpanFrom...
  • From: Andreas <aagas at ix.netcom.com>
  • Date: Fri, 5 Dec 2008 05:30:23 -0500 (EST)

Following on from David Park's post last week about Grid problems http://mathforum.org/kb/thread.jspa?threadID=1863053&tstart=45.

The following code illustrates two problems with Grid[]

panel1 = Panel["place plot here", ImageSize -> {200, 150}];
panel2 = Panel["place plot here", ImageSize -> {200, 100}];

Grid[{
  {"Title", SpanFromLeft, SpanFromLeft, "Title", SpanFromLeft, 
   SpanFromLeft},
  {panel1 , SpanFromLeft, SpanFromLeft, "Year1", "", 58},
  {SpanFromAbove, SpanFromBoth, SpanFromBoth, "Year2", "", 35},
  {SpanFromAbove, SpanFromBoth, SpanFromBoth, "Year3", "", 14},
  {SpanFromAbove, SpanFromBoth, SpanFromBoth, "Title", SpanFromLeft, 
   SpanFromLeft},
  {SpanFromAbove, SpanFromBoth, SpanFromBoth, panel2, SpanFromLeft, 
   SpanFromLeft},
  {"Title", SpanFromLeft, "Val", "Title", SpanFromLeft, 
   SpanFromLeft},
  {"Sub ", SpanFromLeft, 1, panel2, SpanFromLeft, SpanFromLeft},
  {"Item", SpanFromLeft, 2, SpanFromAbove, SpanFromBoth, 
   SpanFromBoth},
  {"Item", SpanFromLeft, 3, SpanFromAbove, SpanFromBoth, 
   SpanFromBoth},
  {"Item", SpanFromLeft, 4, SpanFromAbove, SpanFromBoth, 
   SpanFromBoth},
  {"Item", SpanFromLeft, 5, SpanFromAbove, SpanFromBoth, 
   SpanFromBoth}
  },
 Alignment -> {Left, Top},
 Frame -> All,
 ItemSize -> 5]

Grid[{
  {"Title", SpanFromLeft, SpanFromLeft, "Title", SpanFromLeft, 
   SpanFromLeft},
  {panel1 , SpanFromLeft, SpanFromLeft, "Year1", SpanFromLeft, 58},
  {SpanFromAbove, SpanFromBoth, SpanFromBoth, "Year2", SpanFromLeft, 
   35},
  {SpanFromAbove, SpanFromBoth, SpanFromBoth, "Year3", SpanFromLeft, 
   14},
  {SpanFromAbove, SpanFromBoth, SpanFromBoth, "Title", SpanFromLeft, 
   SpanFromLeft},
  {SpanFromAbove, SpanFromBoth, SpanFromBoth, panel2, SpanFromLeft, 
   SpanFromLeft},
  {"Title", SpanFromLeft, "Val", "Title", SpanFromLeft, 
   SpanFromLeft},
  {"Sub ", SpanFromLeft, 1, panel2, SpanFromLeft, SpanFromLeft},
  {"Item", SpanFromLeft, 2, SpanFromAbove, SpanFromBoth, 
   SpanFromBoth},
  {"Item", SpanFromLeft, 3, SpanFromAbove, SpanFromBoth, 
   SpanFromBoth},
  {"Item", SpanFromLeft, 4, SpanFromAbove, SpanFromBoth, 
   SpanFromBoth},
  {"Item", SpanFromLeft, 5, SpanFromAbove, SpanFromBoth, 
   SpanFromBoth}
  },
 Alignment -> {Left, Top},
 Frame -> All,
 ItemSize -> 5]

The 1st Grid[] produced has a problem in the display of the Panel[] in the lower right corner.  Shouldn't the code as entered permit that panel to span down and across the entire area as framed in the section of the Grid[]?  Any way to address this?

The 2nd Grid[] shows the same problem occurring in the Panel[] located in the upper left corner of the grid.  The difference between the 2 Gird[]s is only in replacing the 3 " " cells with SpanFromLeft.  Why should such a change throw off how the cells to the left display?

Does this constitute a bug?  Any way to work around these problems?

Any help much appreciated.


  • Prev by Date: Re: How to substitute a function?
  • Next by Date: Re: Rearranging expressions in a user-defined form
  • Previous by thread: Re: Rotation about 3 principal axes
  • Next by thread: Mathematica 7: Exclusions don't work automatically with Plot3D and UnitStep