Skip to content
Tutorials Center
My learning

Topics

Lesson 26 of 42 ยท References and Long Documents

Table of Contents in Word

Build an automatic table of contents in Word from heading styles, update it, customize levels and leaders, add a table of figures and fix common TOC problems.

A table of contents (TOC) lists the headings of a document with their page numbers. In Word, it is not something you type: it is a field built from your heading styles. Change a heading or add pages, update the field, and the TOC is correct again. This is the main reward for using real styles instead of manual bold text.

Step 1: Use heading styles

Word builds a TOC from paragraphs that use Heading 1, Heading 2, Heading 3 and so on (found in Home > Styles). The shortcut keys are Ctrl+Alt+1, Ctrl+Alt+2 and Ctrl+Alt+3.

  • Heading 1 for chapters, Heading 2 for sections, Heading 3 for subsections.
  • Do not skip levels (1 straight to 3).
  • Do not fake headings with bold and a bigger font; Word cannot see them.

Open View > Navigation Pane. If your headings are styled correctly, they all appear there as an outline. If something is missing, it is not styled as a heading.

Step 2: Insert the TOC

Place the cursor where the TOC should go (normally after the cover page). On the References tab, click Table of Contents and choose:

  • Automatic Table 1 / 2: includes a title ("Contents" or "Table of Contents"), and shows headings with page numbers.
  • Manual Table: placeholder text that you type. It never updates, so avoid it.
  • Custom Table of Contents...: opens the options dialog (below).

Word inserts the TOC inside a content control with an Update Table tab at the top. Click the Update Table button, or press F9 with the TOC selected.

Update the field

After changing the document, update the TOC. You can choose:

  • Update page numbers only: when only layout changed.
  • Update entire table: when headings were added, removed or renamed.

Printing can update the TOC automatically if File > Options > Display > Update fields before printing is ticked.

Step 3: Customize

Choose Table of Contents > Custom Table of Contents... The dialog lets you set:

Option Effect
Show page numbers Turns page numbers on or off
Right align page numbers Pushes numbers to the right margin
Tab leader Dots, dashes, line, or none between text and number
Formats From template, Classic, Distinctive, Fancy, Modern, Formal, Simple
Show levels How many heading levels to include (1 to 9)
Use hyperlinks instead of page numbers Ideal for web or PDF output
Options... Choose which styles feed which TOC level
Modify... Edit the formatting of TOC 1, TOC 2 etc.

Each TOC level has its own paragraph style: TOC 1, TOC 2, TOC 3. If you want all Level 1 entries bold, modify TOC 1 and every TOC picks it up.

Include other styles

Click Options... and you will see a list of available styles with a number box beside each. Type 1 beside a custom style such as "Appendix Title" to make it a first-level entry. You can also leave a heading out of the TOC by giving it a style that has no TOC level, or by using Add Text > Do Not Show in Table of Contents (References tab, Add Text button).

Mark individual entries

Select text, then Add Text and choose a level. This applies a heading style to the paragraph. It also works for adding something unusual to the TOC. For arbitrary text, use a TC field: press Alt+Shift+O to mark an entry, and in the TOC dialog's Options... tick Table entry fields.

Tables of figures

Captioned pictures, tables and equations can get their own list. After inserting captions (see Captions and Cross-References), choose References > Insert Table of Figures, then pick the Caption label ("Figure", "Table"). The Update Table option works the same as for a TOC.

Cover page and numbering

A TOC usually follows a cover page and might have different page numbers from the body. Use section breaks and Link to Previous in headers and footers to do this. For example, roman numerals for front matter, then arabic numbers starting from 1. Section breaks are covered in the Layout chapter of this course.

How Word builds the TOC

A TOC is a loop over headings: collect each heading's text, level and page, indent by level, add leader dots. This runnable stand-in builds one from a list of headings and a page map. It is Python, not Word.

Python Build a table of contents (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.

An update is just running that function again after the headings change. Here is a hyperlinked TOC like the "Use hyperlinks" option, which is what a PDF or a web page uses:

TOC with hyperlinks from headings

Troubleshooting

  • A heading is missing. It is not in a heading style, or the style is not included in Options.
  • Page numbers are wrong. Update the entire table, and update again after the last edit.
  • Strange formatting after update. Direct formatting in the TOC is lost on update; change the TOC styles instead.
  • "Error! No table of contents entries found." There are no headings in the styles selected.
  • Grey field background. That only shows the field on screen (File > Options > Advanced > Field shading); it does not print.
  • Extra blank page after the TOC. Remove the manual page break, or use Page Break Before on the next Heading 1.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does Word use to build an automatic table of contents?

    The TOC field collects paragraphs that use heading styles (or styles you add under Options).
  2. 2. Which key refreshes a selected TOC?

    F9 updates the selected field.
  3. 3. Where do you change the look of all first-level TOC entries?

    TOC 1 is the paragraph style for first-level entries; modifying it changes all of them.
  4. 4. What creates a list of figures with their page numbers?

    Insert Table of Figures lists captions of one label, such as Figure or Table.

Summary

  • Use real heading styles, check them in the Navigation Pane.
  • References > Table of Contents inserts an automatic field.
  • Update the entire table after you change headings.
  • Customize levels, leaders and TOC 1-3 styles.
  • A Table of Figures does the same for captions.

Next: Captions and Cross-References