({{, (RefLink[Table, paclet:ref/Table])[expr,n]
generates a list of n copies of expr. }, {, (RefLink[Table, paclet:ref/Table])[expr,{i,(Subscript[i, max])}]
generates a list of the values of expr when i runs from 1 to (Subscript[i, max]). }, {, (RefLink[Table, paclet:ref/Table])[expr,{i,(Subscript[i, min]),(Subscript[i, max])}]
starts with i=(Subscript[i, min]). }, {, (RefLink[Table, paclet:ref/Table])[expr,{i,(Subscript[i, min]),(Subscript[i, max]),di}]
uses steps di. }, {, (RefLink[Table, paclet:ref/Table])[expr,{i,{(Subscript[i, 1]),(Subscript[i, 2]),…}}] 
uses the successive values (Subscript[i, 1]), (Subscript[i, 2]), ….}, {, (RefLink[Table, paclet:ref/Table])[expr,{i,(Subscript[i, min]),(Subscript[i, max])},{j,(Subscript[j, min]),(Subscript[j, max])},…]
gives a nested list. The list associated with i is outermost. »}})

OpenersNotesSection(Spacer1)Details

You can use (RefLink[Table, paclet:ref/Table]) to build up vectors, matrices, tensors, and other arrays.

(RefLink[Table, paclet:ref/Table]) uses the standard Wolfram Language iteration specification.

(RefLink[Table, paclet:ref/Table]) evaluates its arguments in a nonstandard way.

(RefLink[Table, paclet:ref/Table])[expr,spec] first evaluates spec, then localizes the variable specified and successively assigns values to it, each time evaluating expr.

(RefLink[Table, paclet:ref/Table]) effectively uses (RefLink[Block, paclet:ref/Block]) to localize values or variables.

(RefLink[Table, paclet:ref/Table])[expr,(Subscript[spec, 1]),(Subscript[spec, 2])] is effectively equivalent to (RefLink[Table, paclet:ref/Table])[Table[expr,(Subscript[spec, 2])],(Subscript[spec, 1])].

OpenersPrimaryExamplesSection(Spacer1)Examples  (37)

OpenersExampleSection0(Spacer1)Basic Examples  (6)

A table of the first 10 squares:

Table[i^2,{i,10}]

A table with i running from 0 to 20 in steps of 2:

Table[f[i],{i,0,20,2}]

A list of 10 x's:

Table[x,10]

Make a 4×3 matrix:

Table[10i+j,{i,4},{j,3}]

MatrixForm[%]

Plot a table:

ListPlot[Table[Prime[i],{i,50}]]

Arrange a table in a column:

Column[Table[Prime[i],{i,5}]]

OpenersExampleSection1(Spacer1)Scope  (6)

The index in the table can run backward:

Table[f[i],{i,10,-5,-2}]

Make a triangular array:

Table[10i+j,{i,5},{j,i}]

TableForm[%]

Make a 3×2×4 array, or tensor:

Table[100i+10j+k,{i,3},{j,2},{k,4}]

Iterate over an existing list:

Table[Sqrt[x],{x,{1,4,9,16}}]

Make an array from existing lists:

Table[j^(1/i),{i,{1,2,4}},{j,{1,4,9}}]

(RefLink[Table, paclet:ref/Table]) evaluates the expression separately each time:

Table[RandomInteger[10],20]

OpenersExampleSection2(Spacer1)Generalizations & Extensions  (2)

The table index can have symbolic values:

Table[2^x+x,{x,a,a+5n,n}]

The variables need not just be symbols:

Table[a[x]!,{a[x],6}]

Table[x[1]^2+x[2]^2,{x[1],3},{x[2],3}]

OpenersExampleSection3(Spacer1)Applications  (4)

Make a table of graphics:

Table[Plot[BesselJ[n,x],{x,0,10}],{n,4}]

Generate the corners of a polygon:

Graphics[Polygon[Table[{Sin[2 n Pi/5],Cos[2 n Pi/5]},{n,0,5}]]]

Make Pascal's triangle:

Column[Table[Binomial[i,j],{i,0,8},{j,0,i}],Center]

Compare font sizes from 10 points to 20 points:

Table[Style["text",s],{s,10,20}]

OpenersExampleSection4(Spacer1)Properties & Relations  (13)

OpenersExampleSubsection0(Spacer1)Display of Tables  (5)

Use (RefLink[ListPlot, paclet:ref/ListPlot]), (RefLink[ListLinePlot, paclet:ref/ListLinePlot]) and similar functions to visualize numeric tables:

ListLinePlot[Table[DigitCount[n,2,1],{n,128}]]

Use (RefLink[Grid, paclet:ref/Grid]) to format a two-dimensional table:

Grid[Table[{i,Prime[i]},{i,10}]]

Two-dimensional numeric tables can be visualized with (RefLink[ArrayPlot, paclet:ref/ArrayPlot]) and (RefLink[MatrixPlot, paclet:ref/MatrixPlot]):

ArrayPlot[Table[GCD[i,j],{i,10},{j,10}]]

Print the values of the table index while the table is being generated:

Table[Print[i];i^i^i,{i,3}]

Monitor the values by showing them in a temporary cell:

Monitor[Table[Pause[1];i^i^i,{i,3}],i]

OpenersExampleSubsection1(Spacer1)Relations to Other Functions  (5)

(RefLink[Range, paclet:ref/Range]) gives the sequence of values of a table iterator:

Range[1,10,2]

Table[i,{i,1,10,2}]

(RefLink[Do, paclet:ref/Do]) evaluates the same sequence of expressions as (RefLink[Table, paclet:ref/Table]), but does not return them:

Do[Print[i^i],{i,3}]

Table[i^i,{i,3}]

(RefLink[Sum, paclet:ref/Sum]) effectively applies (RefLink[Plus, paclet:ref/Plus]) to results from (RefLink[Table, paclet:ref/Table]):

Sum[x^i,{i,3}]

Table[x^i,{i,3}]

(RefLink[Array, paclet:ref/Array]) iterates over successive integers:

Array[#1^#2&,{3,4}]

Array[Function[{x,y},x^y],{3,4}]

Table[x^y,{x,3},{y,4}]

(RefLink[Map, paclet:ref/Map]) applies a function to successive elements in a list:

list = RandomInteger[9,10]

Map[Last[IntegerDigits[#,2]]&,list]

(RefLink[Table, paclet:ref/Table]) can substitute successive elements in a list into an expression:

Table[Last[IntegerDigits[x,2]],{x,list}]

OpenersExampleSubsection2(Spacer1)Nested Tables  (1)

Using multiple iteration specifications is equivalent to nesting (RefLink[Table, paclet:ref/Table]) functions:

Table[i+j,{i,3},{j,i}]

Table[Table[i+j,{j,i}],{i,3}]

OpenersExampleSubsection3(Spacer1)Programmatic Table Construction  (2)

Feed in parameters for tables:

Table[i-j,{i,#1},{j,#2}]&@@{4,5}

Table[i-j,##]&@@{{i,4},{j,5}}

Use (RefLink[Apply, paclet:ref/Apply]) to splice a complete iterator specification into (RefLink[Table, paclet:ref/Table]):

Table[{i[j],j+1},{j,3}]

Apply[Table[x,##]&,%]

(RefLink[With, paclet:ref/With]) can insert the specification for a single iterator:

With[{s={i,5}},Table[i^2,s]]

OpenersExampleSection5(Spacer1)Possible Issues  (6)

For some step sizes, output from (RefLink[Table, paclet:ref/Table]) may not include the upper limit given:

Table[x,{x,0,10,3}]

(RefLink[Table, paclet:ref/Table]) requires list iterator specifications to be given explicitly:

p={x,5};
Table[x^2,p]

Forcing early evaluation of the list resolves the issue:

Table[x^2,Evaluate[p]]

Alternatively, using (RefLink[With, paclet:ref/With]) to lexically replace p with its list form:

With[{p={x,5}},Table[x^2,p]]

(RefLink[Table, paclet:ref/Table]) normally reevaluates at each step:

Table[RandomReal[],{5}]

Table[Evaluate[RandomReal[]],{5}]

The (RefLink[Evaluate, paclet:ref/Evaluate]) is needed to force evaluation of the table before it is fed to (RefLink[Plot, paclet:ref/Plot]):

Plot[Evaluate[Table[BesselJ[n,x],{n,5}]],{x,0,15}]

Compare with:

Plot[Table[BesselJ[n,x],{n,5}],{x,0,15}]

Values of (RefLink[Table, paclet:ref/Table]) variables do not get substituted inside held expressions:

Table[Hold[i],{i,5}]

Use (RefLink[With, paclet:ref/With]) to insert values:

Table[With[{i=i},Hold[i]],{i,5}]

Formatting wrappers such as (RefLink[Grid, paclet:ref/Grid]) give expressions that are no longer lists:

Grid[Table[i j,{i,4},{j,4}]]

x+%

InputForm[%]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Range, paclet:ref/Range])  ▪  (RefLink[DiagonalMatrix, paclet:ref/DiagonalMatrix])  ▪  (RefLink[IdentityMatrix, paclet:ref/IdentityMatrix])  ▪  (RefLink[Array, paclet:ref/Array])  ▪  (RefLink[Do, paclet:ref/Do])  ▪  (RefLink[Sum, paclet:ref/Sum])  ▪  (RefLink[Product, paclet:ref/Product])  ▪  (RefLink[NestList, paclet:ref/NestList])  ▪  (RefLink[NestWhileList, paclet:ref/NestWhileList])  ▪  (RefLink[SparseArray, paclet:ref/SparseArray])  ▪  (RefLink[RecurrenceTable, paclet:ref/RecurrenceTable])  ▪  (RefLink[BooleanTable, paclet:ref/BooleanTable])  ▪  (RefLink[DiscretePlot, paclet:ref/DiscretePlot])  ▪  (RefLink[ParallelTable, paclet:ref/ParallelTable])  ▪  (RefLink[ConstantArray, paclet:ref/ConstantArray])  ▪  (RefLink[StringRepeat, paclet:ref/StringRepeat])  ▪  (RefLink[FindRepeat, paclet:ref/FindRepeat])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Repetitive Operations, paclet:tutorial/RepetitiveOperations])}, {▪(RefLinkPlain[Making Tables of Values, paclet:tutorial/MakingTablesOfValues])}, {▪(RefLinkPlain[Evaluation in Iteration Functions, paclet:tutorial/EvaluationInIterationFunctions])}, {▪(RefLinkPlain[Vectors and Matrices, paclet:tutorial/VectorsAndMatrices])}, {▪(RefLinkPlain[Tensors, paclet:tutorial/Tensors])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Operations on Vectors, paclet:guide/OperationsOnVectors])}, {▪(RefLinkPlain[Constructing Lists, paclet:guide/ConstructingLists])}, {▪(RefLinkPlain[Constructing Matrices, paclet:guide/ConstructingMatrices])}, {▪(RefLinkPlain[Tensors, paclet:guide/Tensors])}, {▪(RefLinkPlain[List Manipulation, paclet:guide/ListManipulation])}, {▪(RefLinkPlain[Integer Sequences, paclet:guide/IntegerSequences])}, {▪(RefLinkPlain[Handling Arrays of Data, paclet:guide/HandlingArraysOfData])}})}})

({{(Spacer1), ({{(Spacer1)Related Links}, {(WebLink[DocumentationFooterIconsRelatedLinks-FastIntro.png(Spacer1)Fast Introduction for Programmers: Lists, http://www.wolfram.com/language/fast-introduction-for-programmers/lists/])}, {(WebLink[DocumentationFooterIconsRelatedLinks-FastIntro.png(Spacer1)Fast Introduction for Programmers: Iterators, http://www.wolfram.com/language/fast-introduction-for-programmers/iterators/])}, {(WebLink[DocumentationFooterIconsRelatedLinks-EIWL.png(Spacer1)An Elementary Introduction to the Wolfram Language, https://www.wolfram.com/language/elementary-introduction/06-making-tables.html])(WebLink[: Operations on Lists, https://www.wolfram.com/language/elementary-introduction/06-making-tables.html])}, {(WebLink[DocumentationFooterIconsRelatedLinks-NKS.png(Spacer1)NKS|Online, http://www.wolframscience.com/nksonline/index/search.cgi?SearchIndex=Table]) ((WebLink[A New Kind of Science, http://www.wolframscience.com/nksonline/]))}})}})