Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Grids
Replies: 1   Last Post: Jul 1, 2013 5:44 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
David Park

Posts: 1,557
Registered: 5/19/07
Re: Grids
Posted: Jul 1, 2013 5:44 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I'm fairly certain you will get a simpler answer to this, but I have fancied
up your table a little just for illustration. I used thick lines in some
places and thin lines for the dividers between the rows of values. I used
two different background colors, one for the headings and another for the
values. And I used a special font for the heading labels. I did this using
the TableMaker facility in the Presentations Application. (However, below I
also give the regular Grid expression so you can see what the table looks
like.)

TableMaker allows one to "draw" a table just as one might draw a graphic.
There are commands for inserting blocks of table values, drawing Frames and
Dividers, specifying Alignments, Spacings, Backgrounds and styles. The
tables is displayed in the notebook but a palette is also produced that
shows the form of the table and from which one can paste positions, given by
{row, column}, into the command. One can keep adding items and
reevaluating.

<< Presentations`

x1 = Range[-3, 3];
g[x1_] := x1^2;
y1 = g[x1];

tableExpression =
MakeTable[x1y1Table, 8, 2][
TMSubmatrix[{1, 1}, {{"xVal", "yVal"}}],
TMItemStyle["Row", Directive[Bold, FontFamily -> "Century"], {1, 1}],
TMSubmatrix[{2, 1}, Transpose[{x1}]],
TMSubmatrix[{2, 2}, Transpose[{y1}]],
TMFrame["Block", Thick, {1, 1}, {8, 2}],
TMDividers["CenterRows", Black],
TMDividers["CenterColumns", Thick],
TMDividers["Row", Thick, {1, 1}, After],
TMBackground["Row", ColorData["Legacy"]["Bisque"], {1, 1}],
TMBackground["Block",
ColorData["Legacy"]["LemonChiffon"], {2, 1}, {8, 2}]
]

The generated Grid expression can be obtained by:

tableExpression // InputForm

Grid[{{"xVal", "yVal"}, {-3, 9}, {-2, 4}, {-1, 1}, {0, 0},
{1, 1}, {2, 4}, {3, 9}}, Dividers -> {{2 -> Thickness[Large]},
{2 -> GrayLevel[0], 3 -> GrayLevel[0], 4 -> GrayLevel[0],
5 -> GrayLevel[0], 6 -> GrayLevel[0], 7 -> GrayLevel[0],
8 -> GrayLevel[0], 2 -> Thickness[Large]}},
Spacings -> {{None, {}}, {None, {}}},
Background -> {{}, {}, {{{1, 1}, {1, 2}} ->
RGBColor[1., 0.898053, 0.771844], {{2, 8}, {1, 2}} ->
RGBColor[1., 0.980407, 0.803903]}},
Frame -> {{}, {}, {{{1, 8}, {1, 2}} -> Thickness[Large]}},
ItemStyle -> {{}, {}, {{{1, 1}, {1, 2}} ->
Directive[Bold, FontFamily -> "Century"]}},
ItemSize -> {{Automatic, {}}, {Automatic, {}}},
Alignment -> {{Center, {}}, {Center, {}}, {}},
BaseStyle -> {14, Plain, FontFamily -> "Times"}]

That would be the normal way of specifying the table.


David Park
djmpark@comcast.net
http://home.comcast.net/~djmpark/index.html




From: Mark [mailto:big.dog1@att.net]


Hello:
'
I am trying to get the x1 and y1 results of a basic function displayed in
two columns with a grid around each x1 and y1 entry.
'
However, my result only appears with a grid around the exterior of the x1
and y1 values, and the only the column headings.
There is a vertical divider between the x1 and y1 columns, but the row
dividers are missing.

What is the syntax to get the row dividers to appear?

Thanks in advance, and below is what I have tried so far:

x1 = Range[-3, 3](*Define the range of x1 values.*)

g[x1_] := x1^2(*Define the function*)

y1 = g[x1](*Calculate the y values of the function*)

Out[21]= {9, 4, 1, 0, 1, 4, 9}
'---------------------------------------
'
Grid[{{xVal, yVal}, {Column[x1], Column[y1]}}, Frame -> All](*The result of
this function in columar format*)
'---------------------------------------

'
I also tried the the below statement as well but it gives the same result.

Grid[{{xVal, yVal}, {Column[x1], Column[y1]}}, Frame -> All, Dividers ->
All]

Mark





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.