MathGroup Archive 2003

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

Search the Archive

Creating Nested GridBoxes

  • To: mathgroup at smc.vnet.net
  • Subject: [mg43209] Creating Nested GridBoxes
  • From: bghiggins at ucdavis.edu (Brian Higgins)
  • Date: Wed, 20 Aug 2003 22:24:55 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Mathgroup,

I am interested in using GridBoxes to create a table that has row
headings and column headings . The headings should not have the same
style or background as the table.  Here is a simple example of what I
am trying to do. First , I create my table

box1 = StyleBox[ GridBox[{{a, b, d, e}, {f, g, h, i}, {j, k, l , m}},
RowLines -> True,         ColumnLines -> True, GridFrame -> True],  
Background -> RGBColor[1, 1, 0]];

Here are the column headings:

columnbox = StyleBox[ GridBox[{{1, 2, 3, 4}}, RowLines -> False,
ColumnLines -> False,         GridFrame -> False], Background ->
RGBColor[1, 1, 1]];

Now if I combine these two sets of Gridboxes I get the desired result

DisplayForm[GridBox[{{columnbox}, {box1}}]]

The difficulty I have is adding the row headings

rowbox = StyleBox[ GridBox[Transpose[{{" ",1, 2, 3}}], RowLines ->
False, ColumnLines -> False,GridFrame -> False], Background ->
RGBColor[1, 1, 1]];

DisplayForm[GridBox[{{rowbox},{GridBox[{{columnbox}, {box1}}]}}]]

which does not give the desired result. I have tried several
combinations but have had no luck. I suspect this is straightforward
to do but it escapes me.

Thanks in advance for helping me with my query.

Regards,
Brian


  • Prev by Date: Re: Leibniz Definition Of Pi Not In 5.0.0?
  • Next by Date: Re: Leibniz Definition Of Pi Not In 5.0.0?
  • Previous by thread: Creating Nested GridBoxes
  • Next by thread: Re: Creating Nested GridBoxes