TableForm vs. Grid (v.6)
- To: mathgroup at smc.vnet.net
- Subject: [mg76953] TableForm vs. Grid (v.6)
- From: Helen Read <hpr at together.net>
- Date: Wed, 30 May 2007 05:33:06 -0400 (EDT)
- Reply-to: HPR <read at math.uvm.edu>
My calculus students frequently make tables for all kinds of purposes. In past versions of Mathematica, we liked to display tables in TableForm, with TableHeadings identifying the columns. Say we have a curve defined parametrically: x[t_]=15t^2+15t-30 y[t_]=t^4+25t+5 (* make a table *) t1=Table[{t,x[t],y[t]},{t,-5,5}]; (* Old way: display it in TableForm *) TableForm[t1,TableHeadings->{None,{"t","x","y"}] In 6.0, however, the default spacing between columns of the table is a bit tight (much tighter than it used to be), so we'd probably end up doing something like the following. TableForm[t1,TableHeadings->{None,{"t","x","y"},TableSpacing->{1,2}] Of course, now we can now use Grid, which is far more flexible than TableForm ever was. However, there is no obvious way to label the rows or columns in a Grid, so we are faced with something like the following. Grid[Prepend[t1,{"t","x","y"}],Spacings->2] or perhaps Grid[Prepend[t1,{"t","x","y"}],Spacings->2,Frame->All] This is most likely the way we will do it in class. I think, though, that a nice addition to Grid would be options for row and column labels, with None as the default. (If we had options for RowLabels and ColumnLabels for Grid, we could dispense with TableForm entirely.) -- Helen Read University of Vermont