Re: Grids
- To: mathgroup at smc.vnet.net
- Subject: [mg131365] Re: Grids
- From: Helen Read <readhpr at gmail.com>
- Date: Mon, 1 Jul 2013 05:50:58 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-outx@smc.vnet.net
- Delivered-to: mathgroup-newsendx@smc.vnet.net
- References: <kqomii$p74$1@smc.vnet.net>
You could try something like the following, but it seems like a really hard way to do it and it doesn't look very good. Grid[{{"x", "g(x)"}, {Column[x1, Dividers -> All], Column[g[x1], Dividers -> All]}}, Frame -> Outer] Or maybe this (which still doesn't look great). Grid[{{"x", "y"}, {Column[x1, Dividers -> All], Column[g[x1], Dividers -> All]}}, Spacings -> {0, 0}, Frame -> Outer] It's much easier to just make a table. g[x_] := x^2 Grid[Table[{x, g[x]}, {x, -3, 3}], Frame -> All] And if you want column headers, use Join to glom them onto the Table. Grid[Join[{{"x", "g(x)"}}, Table[{x, g[x]}, {x, -3, 3}]], Frame -> All] Helen Read University of Vermont On 6/30/2013 3:26 AM, Mark wrote: > 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 >