Make a Grid of Output Data
Using Grid...
For detailed control of formatting, use Grid.
Start with some data
Here is data on objects and their dimensions:
Format the data as a grid
Make a grid of the data:
Specify how the data in the grid should align
Use the Alignment option to specify how items in columns should align:
Add grid lines
Add grid lines with the Frame option:
Add column headings
Add a row of column headings to the grid. Make the headings bold and extend the second heading into the third and fourth columns with SpanFromLeft:
Add row headings
Add a column of row headings to the grid. Make the headings bold, rotate them so that they are vertical and extend them across multiple rows with SpanFromAbove:
- Type the Degree symbol as deg.
Using TableForm...
TableForm is a simple alternative to Grid.
Start with some data
Here is data on objects and their dimensions:
Format the data as a grid
Make a grid of the data:
Specify how the data in the grid should align
Use the TableAlignments option to specify how items in columns should align:
Add column headings
Add a row of column headings to the grid:
You can add column and row headings to the contents of a Grid programmatically using ArrayFlatten: