Grid/Table Formatting

General discussion about Mathematica features and functionality...
Forum Rules
By using the Wolfram Faculty Program Forum, you agree not to post any abusive, obscene, vulgar, slanderous, hateful, threatening, or sexually oriented material. Wolfram Faculty Program Forum administrators have the right to remove, edit, move or close any topic at any time should we see fit.

Personal Information: Posts in this forum may be viewed by non-members; however, the forum prohibits non-members from viewing your profile. Although your email address is hidden from both non-members and members, your account is initially configured to allow members to contact you via email through the forum. If you wish to hide your profile, or prohibit others from contacting you directly, you may change these settings by updating your profile through the User Control Panel.

Attachments: Attachments are not currently enabled on this forum. To share a file with others on this site, simply upload your file to the online storage service of your choice and include a link to the file within your post. If your school does not offer an online file storage and sharing service, the following sites provide free basic online file storage and sharing: Mozy, FilesAnywhere, Adrive, and KeepandShare.

Grid/Table Formatting

Postby Rob_Holman » Thu Mar 22, 2012 1:06 am

Hello all:

I'm trying to get the program to generate a grid filled with a table that I've programmed to make practice exercises. I have two questions:

1. Suppose I generate a table of 12 problems... can I get Mathematica to organize those 12 items into a 4 X 3 grid, for example? My attempts to do this have always resulted in a 4 X 3 grid wherein each cell contained 12 items.

2. I've gotten the grid dividers built like I want, but the entry in each box basically fills the box. I'd like to leave a lot of extra room in the bottom of each grid "cell" to allow room for students to show work, but I can't seem to do this well. I've tried the Alignment and Spacing commands, but neither of these seem to do quite what I want. I've thought of making each entry in the Table a column, where the entries below the top entry are blank, but hoped there was a more elegant way to achieve what I'd like.

Any suggestions would be greatly appreciated!

Rob
User avatar
Rob_Holman
 
Posts: 14
Joined: Wed Feb 29, 2012 7:03 pm
Organization: The Walker School
Department: Mathematics and Science

Re: Grid/Table Formatting

Postby Michael_Morrison » Fri Mar 23, 2012 3:27 pm

Rob_Holman wrote:1. Suppose I generate a table of 12 problems... can I get Mathematica to organize those 12 items into a 4 X 3 grid, for example? My attempts to do this have always resulted in a 4 X 3 grid wherein each cell contained 12 items.


Hi Rob,

If you're creating your problems all at once (like with Table), then it's easy to use Partition to get them into smaller sublists, e.g.
TraditionalForm[
Grid[Partition[Table[x^i + i x^(i - 1) + i, {i, 12}], 3]]]


Rob_Holman wrote:2. I've gotten the grid dividers built like I want, but the entry in each box basically fills the box. I'd like to leave a lot of extra room in the bottom of each grid "cell" to allow room for students to show work, but I can't seem to do this well. I've tried the Alignment and Spacing commands, but neither of these seem to do quite what I want. I've thought of making each entry in the Table a column, where the entries below the top entry are blank, but hoped there was a more elegant way to achieve what I'd like.


There may be a way to do this directly with Grid by using Spacings and Alignment, but I took an easier route and put each element into a Pane, which allows me to specify the exact size I want. I left the width for Mathematica to set (using Automatic) and hard-coded a vertical height of 50. (I also turned on the dividers to see this padding a bit better.)
TraditionalForm[
Grid[Partition[
Table[Pane[x^i + i x^(i - 1) + i, {Automatic, 50}], {i, 12}], 3],
Frame -> All]]

Thanks,
Michael
User avatar
Michael_Morrison
 
Posts: 42
Joined: Fri Sep 11, 2009 9:50 pm
Organization: Wolfram Research, Inc.
Department: Academic Initiatives

Re: Grid/Table Formatting

Postby Rob_Holman » Fri Mar 23, 2012 8:08 pm

Michael:

This is perfect! Thanks so much for your help.

Rob
User avatar
Rob_Holman
 
Posts: 14
Joined: Wed Feb 29, 2012 7:03 pm
Organization: The Walker School
Department: Mathematics and Science


Return to General Mathematica Discussion

Who is online

Users browsing this forum: No registered users and 5 guests

cron