Table of Contents – Test Page

The table of contents element only adds links if a headline has an id attribute. Fortunately, we can simply assign ids dynamically.

A nice demo article

The table of contents element only adds links if a headline has an id attribute. Fortunately, we can simply assign ids dynamically by using a bit of JavaScript.

How was this created?

Check the source to find out!

Even nicer with links to headlines 😊

This h4 is an important announcement

We want this headline in the TOC for testing purposes to see that headlines do not need to be ordered from h1-h4, but can come in unexpected ways.

Sub1

Subsub1-1

Subsub1-2

Sub2

Subsub2-1

Subsub2-2

Sub3