Skip to content
Tutorials Center
My learning

Topics

Lesson 19 of 42 ยท Tables, Images and Graphics

Tables in Microsoft Word

Learn how to insert, select, edit, sort and calculate in Word tables: Insert Table, Draw Table, Tab key tricks, Sort dialog, and =SUM(ABOVE) formulas.

A table is a grid of rows and columns whose cells can hold text, numbers, pictures and even other tables. In Word, tables are the right tool for data that has columns (prices, schedules, comparisons). They are the wrong tool for page layout: use columns, tabs or text boxes for that.

This lesson covers the mechanics: creating a table, moving around in it, adding and removing rows and columns, sorting, and simple formulas. The next lesson, Formatting Word Tables, covers how tables look.

Creating a table

There are four ways to start. All of them live on the Insert tab, in the Table button:

  1. Grid picker. Drag across the small grid to choose columns and rows (up to 10 by 8). Fast, but limited in size.
  2. Insert Table... Opens a dialog where you type the number of columns and rows, and choose AutoFit behavior: fixed column width, AutoFit to contents or AutoFit to window.
  3. Draw Table. The pointer becomes a pencil. Drag a rectangle for the outside, then draw lines inside to split cells. Use this for irregular layouts. Press Esc to stop drawing.
  4. Convert Text to Table... Select text that is already separated by tabs, commas or paragraphs, then choose Insert > Table > Convert Text to Table. Word guesses the number of columns from the separator you pick.

Two extras are worth knowing. Excel Spreadsheet embeds a small working Excel sheet, and Quick Tables offers ready-made calendars and lists.

Typing +---+---+ and pressing Enter also creates a table. The dashes set the column widths. It is a classic keyboard-only trick.

Moving and selecting

Inside a table, the Tab key moves to the next cell, and Shift+Tab moves back. Pressing Tab in the last cell adds a new row. That is the quickest way to fill a table.

To select Do this
One cell Click the left edge of the cell (pointer turns into a black arrow)
A row Click in the margin to the left of the row
A column Click just above the column's top border (small black down arrow)
Several cells Drag, or click one cell and Shift+click another
The whole table Click the four-arrow handle at the top-left corner, or press Alt+5 on the numeric keypad with Num Lock off

Rows, columns and cells

With the cursor inside the table, two contextual tabs appear: Table Design and Layout. The Layout tab holds the structure tools:

  • Insert Above / Below / Left / Right add rows or columns next to the current cell.
  • Delete removes cells, columns, rows or the whole table. Pressing the Delete key only clears the contents.
  • Merge Cells joins selected cells into one. Split Cells divides one into a number of rows and columns. Split Table cuts the table in two at the cursor row.
  • Distribute Rows / Columns makes the selected rows or columns equal in size.
  • Properties sets exact row height, column width, alignment on the page and text wrapping around the table.

You can also drag a border to resize. Hold Alt while dragging to see precise measurements on the ruler.

What is under the hood

A .docx file is a zip archive of XML files. A table is a w:tbl element containing w:tr (rows) and w:tc (cells), and each cell contains paragraphs. This stand-in builds that structure so you can see it. It is plain Python, not Word.

Python A table as WordprocessingML (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Every row has the same cell count here, but a merged cell is stored as one w:tc with a w:gridSpan value. This explains why merged cells can cause trouble when you sort or convert a table to text.

Sorting a table

Click in the table, then Layout > Sort (or Home > Sort for lists). The Sort dialog offers up to three keys. For each one you choose a column, a type (Text, Number or Date) and an order (Ascending/Descending). Tick Header row so the first row stays put.

The type matters. As text, "10" sorts before "9". As a number, 9 comes first. Sorting also fails to behave if the table has merged cells, so unmerge first.

Formulas in cells

Word tables can calculate. Put the cursor in a cell, choose Layout > Formula, and Word suggests =SUM(ABOVE) or =SUM(LEFT). Other functions include AVERAGE, COUNT, MAX, MIN, PRODUCT and IF. You can also use cell references like =B2*C2, where columns are letters and rows are numbers, as in Excel.

Formulas are fields. They do not update by themselves: select the table and press F9 to refresh them, or they refresh when you print. For real number-crunching, paste in an Excel table instead.

Python Sort and SUM(ABOVE) stand-in

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Common mistakes

  • Using empty rows or tabs to create space. Use cell padding and row height.
  • Building a table for a single column of text. Use a list.
  • Forgetting Header row in Sort, so headings end up in the middle.
  • Mixing merged cells with sorting, formulas or screen readers. Keep data tables simple.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which key adds a new row when the cursor is in the last cell of a table?

    Tab moves to the next cell, and in the last cell it creates a new row.
  2. 2. Why might the values 10 and 9 sort wrongly in a Word table?

    As text, the character 1 comes before 9, so 10 sorts before 9. Choose Number as the type.
  3. 3. What must you do to refresh a formula such as =SUM(ABOVE) after changing a number?

    Formulas are fields and are refreshed with F9 (or on print).
  4. 4. Which is the best choice for turning tab-separated text into a table?

    Convert Text to Table reads the separators and builds the grid.

Summary

  • Create tables from the grid, Insert Table, Draw Table or by converting text.
  • Tab moves between cells, and Tab in the last cell adds a row.
  • The Layout tab inserts, deletes, merges, splits and distributes cells.
  • Sort by up to three keys; pick the right type and tick Header row.
  • Formulas such as =SUM(ABOVE) are fields refreshed with F9.

Next: Formatting Word Tables