Re: Creating Nested GridBoxes
- To: mathgroup at smc.vnet.net
- Subject: [mg43537] Re: [mg43209] Creating Nested GridBoxes
- From: Omega Consulting <info at omegaconsultinggroup.com>
- Date: Fri, 19 Sep 2003 03:42:01 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Typesetting can be quite an art. Here's a couple of suggestions: Using the definitions from your email: DisplayForm[GridBox[{{rowbox, GridBox[{{columnbox}, {box1}}]}}]] That doesn't quite line up right. You can try putting them all in the same GridBox. bg[x_] := fb@ButtonBox[x, Background -> RGBColor[1, 1, 0]] fb[x_] := FrameBox[x, BoxMargins -> {{0, 0}, {0, 0}}] onegrid = GridBox[{{" ", 1, 2, 3, 4}, {1, bg@a, bg@b, bg@d, bg@e}, {2, bg@f, bg@g, bg@h, bg@i}, {3, bg@j, bg@k, bg@l , bg@m}}, RowSpacings -> 0, ColumnSpacings -> 0, RowsEqual -> True, ColumnsEqual -> True] // DisplayForm At 06:53 AM 8/19/2003, Brian Higgins wrote: >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 > > >-Dale -------------------------------------------------------------- Omega Consulting "The final answer to your Mathematica needs" http://omegaconsultinggroup.com