Using Dataset...

Dataset gives a quick, left-aligned view of tabular data in an array:

In[1]:=
Click for copyable input
Out[1]=

When the data is a list of associations, Dataset displays the association keys as column headings:

In[2]:=
Click for copyable input
Out[2]=

Using Grid...

For detailed control of formatting, use Grid.

Start with some data

Here is data on objects and their dimensions:

In[3]:=
Click for copyable input

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]:=
Click for copyable input

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]=
  • In contrast to Grid, TableForm does not support different alignments for individual columns.

Add column headings

Add a row of column headings to the grid:

Out[12]=
Notes
Type data into a grid using Insert Table/Matrix/New.

You can add column and row headings to the contents of a Grid programmatically using ArrayFlatten:

Out[14]=