此为 Mathematica 4 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.2)

TableForm

Usage

TableForm[list] prints with the elements of list arranged in an array of rectangular cells.
TableForm[list] 用在矩形单元数组中排列的 list 的元素显示。


Notes

• 每行的高度和每列的宽度由行或列中元素的最大数目决定。 • TableForm 显示在一列中的单层列表。它把二层列表显示为二维表。更深的嵌套列表缺省用在行和列间的相邻维交替显示。
• Arrays in which all sublists at a particular level are not of the same length display as ragged tables. 在一个特殊层中没有相同长度的所有子列表阵列显示为粗糙表。 • 可以给出下面的选项:
"\!\(\*StyleBox[\"\\\"TableAlignments\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"Automatic\\\"\", \"MR\"]\) "在每一维中如何排列项
"\!\(\*StyleBox[\"\\\"TableDepth\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"Infinity\\\"\", \"MR\"]\) "包括的最大层数
"\!\(\*StyleBox[\"\\\"TableDirections\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"Automatic\\\"\", \"MR\"]\) "是否安排维为行或列
"\!\(\*StyleBox[\"\\\"TableHeadings\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"None\\\"\", \"MR\"]\) "如何标记表项
"\!\(\*StyleBox[\"\\\"TableSpacing\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"Automatic\\\"\", \"MR\"]\) "在每一维中的项之间放置多少空格
TableForm 起一个包装的作用,影响打印,但不影响计算。
• 参见Mathematica 全书: 1.8.2 and 节 2.8.8.
Further Examples

TableForm displays a list of lists as a table.

In[1]:=  

Out[1]//TableForm=

This centers the column.

In[2]:=  

Out[2]//TableForm=

This displays to a depth of  .

In[3]:=  

Out[3]//TableForm=

This is the default setting for the option TableDirections.

In[4]:=  

Out[4]//TableForm=

This reverses the direction.

In[5]:=  

Out[5]//TableForm=

This gives all columns.

In[6]:=  

Out[6]//TableForm=

This puts integer labels in a 2 x 2 x 2 array.

In[7]:=  

Out[7]//TableForm=

This gives a table where rows are labeled by integers and columns by a list of strings.

In[8]:=  

Out[8]//TableForm=

This leaves 6 spaces between the entries in each row and one space between successive rows.

In[9]:=  

Out[9]//TableForm=