Try now in the
Open Cloud »
(no sign-in required)

# Multiplication Tables

Instantly make a multiplication table of any size.

Run the code to create the data for a 10×10 multiplication table. Try other arithmetic operations, like addition (+) or division (/):

Table makes lists of things.

Heres a list of 10 even numbers:

 In[1]:= XTable[a*2, {a, 10}]
 Out[1]=

If you make a table with two indices (a and b), you get a list of lists. This is the data for a multiplication table:

 In[2]:= XTable[a*b, {a, 10}, {b, 10}]
 Out[2]=

 In[1]:= XTable[a*b, {a, 10}, {b, 10}]
 Out[1]=

Lay out the numbers in a grid. Try making different sizes of grids:

Grid formats a list of lists as a neat grid:

 In[1]:= XGrid[{{1, 2, 3}, {4, 5, 6}}]
 Out[1]=

Grid is often used together with Table because Table makes lists of lists:

 In[2]:= XGrid[Table[a*b, {a, 10}, {b, 10}]]
 Out[2]=

Use FrameAll to put lines in the grid:

 In[3]:= XGrid[Table[a*b, {a, 10}, {b, 10}], Frame -> All]
 Out[3]=

 In[1]:= XGrid[Table[a*b, {a, 10}, {b, 10}], Frame -> All]
 Out[1]=

Add color. Try other colorsfor example LightGreen, LightOrange, or LightGray:

Nearly every aspect of the appearance of grids can be customized. You can make the background light yellow:

 In[1]:= XGrid[Table[a*b, {a, 10}, {b, 10}], Frame -> All, Background -> LightYellow]
 Out[1]=

Lighten the grid lines with FrameStyleLightGray:

 In[2]:= XGrid[Table[a*b, {a, 10}, {b, 10}], Frame -> All, Background -> LightYellow, FrameStyle -> LightGray]
 Out[2]=

 In[1]:= XGrid[Table[a*b, {a, 10}, {b, 10}], Frame -> All, Background -> LightYellow, FrameStyle -> LightGray]
 Out[1]=

Use 8-point type. Try font sizes other than 8for example, 5:

You can customize the style of the items in the grid. This sets the size of the font to 8 points (a point is a printers measure equal to 1/72 inch):

 In[1]:= XGrid[Table[Style[a*b, 8], {a, 10}, {b, 10}], Frame -> All, Background -> LightYellow, FrameStyle -> LightGray]
 Out[1]=

You might want to make the font smaller if your grid is very large:

 In[2]:= XGrid[Table[Style[a*b, 8], {a, 25}, {b, 25}], Frame -> All, Background -> LightYellow, FrameStyle -> LightGray]
 Out[2]=

 In[1]:= XGrid[Table[Style[a*b, 8], {a, 30}, {b, 30}], Frame -> All, Background -> LightYellow, FrameStyle -> LightGray]
 Out[1]=

Share ItMake a multiplication table website:

Deploy a form that asks for a number and makes a multiplication table from 1 to that number:

 In[1]:= XCloudDeploy[FormFunction[{"n" -> "Integer"}, (Grid[Table[Style[a*b, 12], {a, #n}, {b, #n}], Frame -> All, Background -> LightYellow, FrameStyle -> LightGray]) &, "PNG"], "Permissions" -> "Public" ]
 Out[1]=

Click the link in the output to visit the site.

Share the link by right-clicking it and choosing Copy Address. Paste the link into an email, tweet, or other message.

 In[1]:= XCloudDeploy[FormFunction[{"n" -> "Integer"}, (Grid[Table[Style[a*b, 12], {a, #n}, {b, #n}], Frame -> All, Background -> LightYellow, FrameStyle -> LightGray]) &, "PNG"], "Permissions" -> "Public" ]
 Out[1]=