How to Place Word TOC Subheadings on the Same Line
Question details
The user wants to format a Table of Contents (TOC) in a document so that multiple subheadings and their corresponding page numbers appear together on a single line.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Customizing the layout of an automatically generated Table of Contents to save space or achieve a specific document style.
- Observed behavior
- The word processor automatically places each heading and subheading on a new line by default, and there is no built-in setting to group sub-entries on the same line with comma separators.
Ensure you have completely finished writing and editing your document before adjusting the Table of Contents, as any automatic TOC updates will overwrite your manual layout adjustments.
Manually Format and Lock the Table of Contents
Since there is no built-in automatic setting, you can manually arrange the subheadings on the same line and then lock the TOC field to prevent it from reverting when the document updates.
Word fields automatically regenerate based on the document headings. Locking the TOC field ensures that your custom spacing and formatting adjustments remain intact even if the document is saved or printed.
Insert your Table of Contents normally by navigating to References > Table of Contents.
Manually delete the paragraph breaks between the subheadings you want to combine. You can separate them using commas, semicolons, or spaces according to your preference.
Highlight the entire Table of Contents by clicking and dragging over the text, or by clicking the TOC container tab.
Press Ctrl + F11 on your keyboard to lock the TOC. This prevents automatic updates from erasing your manual formatting.

Unlink the TOC to Convert it to Static Text
If you are finalizing a document and no longer need the TOC to update automatically, converting it to regular text allows unrestricted formatting.
Format Documents Effortlessly with WPS Office
While standard word processors often require complex workarounds to customize Table of Contents layouts, WPS Office provides a highly compatible, free, and intuitive alternative for all your document formatting needs. Enjoy a familiar interface and seamless migration without the heavy subscription fees.
- 1. Download and Install: Get WPS Office for free from the official website and install it on your device.
- 2. Open Your Document: Launch WPS Writer and open your existing Word document directly without format loss.
- 3. Edit Seamlessly: Use the familiar References tab to generate, modify, and manage your Table of Contents.

Frequently Asked Questions
How do I unlock a Table of Contents if I need to update it?
To unlock a previously locked Table of Contents, select the TOC field and press Ctrl + Shift + F11. You can then update the field, but note that any manual line breaks you removed will be regenerated to default.
Can I use a VBA macro to fix the TOC formatting automatically?
Yes, a VBA macro can automate the process of finding specific heading levels in the TOC and moving them to the same line. However, you will still need to run the macro every time you update the TOC, as updating it will restore the default line breaks.
Why does updating the TOC remove my custom text and formatting?
The Table of Contents is an automated field block. When you choose to update the entire table, the word processor completely deletes the existing field and rebuilds it from scratch based on the current headings in your document, wiping out manual edits.




