How to add line items to a table of contents?

I can insert a table of contents in theory, but all it actually creates is a table cell that says, “Table of Contents,” with no actual table of contents. How can I add the chapters to the table of contents in a way that’ll take readers to the chapter they click or tap on? This is for an ebook.

You need to use paragraph styles to identify your chapters and sections, and then tell Writer to use those particular styles to build the index. This last part is done in Tools → Outline numbering: by default, Writer have Heading 1 for the level 1 (let’s say, the chapters), Heading 2 for level 2 (the sections) and so on. So if you use the paragraph styles Heading 1, Heading 2, etc. to identify your content, it should work. Just remember to refresh the index (use the right click menu for that) every now and then.