# Header classes in table of contents

**URL:** <https://zola.discourse.group/t/header-classes-in-table-of-contents/2403>\
**Category:** Feature requests\
**Created:** [December 6, 2024, 8:37am UTC](https://zola.discourse.group/t/header-classes-in-table-of-contents/2403 "2024-12-06T08:37:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![spectria-limina](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/spectria-limina/32/1370_2.png) [@spectria-limina](https://zola.discourse.group/u/spectria-limina)\
**Post date:** [December 6, 2024, 8:37am UTC](https://zola.discourse.group/t/header-classes-in-table-of-contents/2403/1 "2024-12-06T08:37:01Z")

</div>

Simple request hopefully: I’d like to be able to access header classes in the table of contents.

```auto
## Header with Class {.classy}

```

Should be accessible in the `toc` as `toc.classes[0] == ".classy"`.

I hope this is an inoffensive suggestion; I have a PR for it already I just need to run this through the discussion group first.

EDIT: The purpose is to be able to style the TOC in the same way that the main doc is styleable.

---

<div class="post-metadata">

**Author:** ![spence](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/spence/32/1022_2.png) [@spence](https://zola.discourse.group/u/spence)\
**Post date:** [December 10, 2024, 2:55pm UTC](https://zola.discourse.group/t/header-classes-in-table-of-contents/2403/2 "2024-12-10T14:55:05Z")

</div>

> EDIT: The purpose is to be able to style the TOC in the same way that the main doc is styleable.

I’m not sure I understand. Do you mean that you just want to be able to style the toc like you would anything else, by adding classes that you can access with your css?

If so, this can already be done. You can use the toc however you want using page.toc or section.toc, and you’re free in the process to add your classes into your template. See the example be;ow from the docs;

> **[Table of Contents | Zola](https://www.getzola.org/documentation/content/table-of-contents/)**
>
> Everything you need to make a static site engine in one binary.

Otherwise I might have misunderstood your question, sorry.
