Open main menu

Snippets/Page Table of contents Top-right

How to use Snippets
List of Snippets
Crystal Clear action run.png
Page Table of contents Top-right
Language(s): CSS
Compatible with: MediaWiki all+ (all)

DescriptionEdit

This small css code moves the page table of contents (TOC) "top-right" instead of (the default) "top-left".

Frequently the page table of contents takes up a large vertical size of the screen while more than half of the (right) screen width remains blank. Page content is needlessly shifted down with subsequent required scrolling. Moving the TOC to top-right makes better use of the available screen space and produces a better visual presentation. Frequently leading sections do not contain too much text, so it perfectly aligns with the TOC.

Visual ExampleEdit

This page!

UsageEdit

It should work for all types and versions of MediaWiki.

CodeEdit

TOC top-right

#toc {
        border:1px solid #aaa;
        background-color: #eed;
        padding: 5px;
        margin: 0px 5px;
        font-size: 95%;
        float: right;
}

NotesEdit

You must be logged in, of course, to see the effect.

TemplateEdit

Use can use {{tocright}} to simulate.

See alsoEdit