Results 1 to 3 of 3

Math Help - Mathematica Table Column Lables and grid lines

  1. #1
    Newbie
    Joined
    Feb 2010
    Posts
    2

    Mathematica Table Column Lables and grid lines

    Ok so there has to be an easy way to do this. If not I'm severely disappointed in mathematica developers, but for some reason I can't figure it out.

    I'm writing problems for an 8th grade text book involving tables and graphs. I want to know how to make a two column table with the headings x and y, and also have the frames throughout the table. Here are the examples I've been trying:

    TableForm[Table[{x, 3 x - 2}, {x, 0, 5}],
    TableHeadings -> {None, {x, y}}]

    This gives a good table and the headings I want, except it doesn't include the frame like I want, and unfortunately the commands "Dividers" and "Frame" aren't valid in the table form function.

    Grid[Table[{x, 3 x - 2}, {x, 0, 5}], Frame -> All]

    This gives all the values and frame that I want, but no headings. The only other way I can think of is to do something like:

    Grid[{{x, y}} \[Union] Table[{x, 3 x - 2}, {x, 0, 5}], Frame -> All]

    which essentially adds the value {x,y} into my list making them appear in my grid. The problem now is that the grid sorts all of the integers first, leave {x,y} at the very bottom. I've tried playing around with the "sort", and "order" commands but can't figure anything out. Does it really have to be that complicated? I feel like there should be a really easy way to do this.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member
    Joined
    Aug 2008
    Posts
    903
    How about:

    Grid[Join[{{Style["xval", 10], Style["yval", 10]}},
    Table[{x, 3 x - 2}, {x, 0, 5}]], Frame -> All]
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Feb 2010
    Posts
    2
    That works! Thanks a bunch!
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. [SOLVED] Amount of truth table lines needed
    Posted in the Discrete Math Forum
    Replies: 2
    Last Post: January 23rd 2011, 03:04 PM
  2. Planes and lines in Wolfram Mathematica
    Posted in the Math Software Forum
    Replies: 3
    Last Post: October 25th 2010, 01:47 AM
  3. Replies: 12
    Last Post: September 24th 2010, 11:10 AM
  4. Table the firts 50 twin primes in Mathematica
    Posted in the Number Theory Forum
    Replies: 5
    Last Post: February 1st 2008, 04:58 AM
  5. Replies: 6
    Last Post: July 8th 2007, 03:13 PM

Search Tags


/mathhelpforum @mathhelpforum