Make a Grid of Output Data
Using Dataset...
Using Grid...
For detailed control of formatting, use Grid.
Start with some data
Here is data on objects and their dimensions:
In[3]:= |
Format the data as a grid
Make a grid of the data:
Out[4]= | ![]() |
Specify how the data in the grid should align
Use the Alignment option to specify how items in columns should align:
Out[5]= | ![]() |
Add grid lines
Add grid lines with the Frame option:
Out[6]= | ![]() |
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:
Out[7]= | ![]() |
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:
Out[8]= | ![]() |
- 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:
In[9]:= |
Format the data as a grid
Make a grid of the data:
Out[10]= | ![]() |
Specify how the data in the grid should align
Use the TableAlignments option to specify how items in columns should align:
Out[11]= | ![]() |
Add column headings
Add a row of column headings to the grid:
Out[12]= | ![]() |
You can add column and row headings to the contents of a Grid programmatically using ArrayFlatten:
Out[14]= | ![]() |