How to put the ToC at the top of the page, parallel to the first paragraph

cssmediawiki

Similarly to this question, I'd like to tweak where the default ToC appears in my MediaWiki site. Currently it appears at the first header, but occasionally I have significant content in the first paragraphs, before any headers.

Is there any way to make the ToC top-aligned with the page, rather than with the first header?

Best Answer

As written in one of the answers, ToC can be added anywhere to your page by using the following keyword:

__TOC__

If you want to add TOC to same place on every page, you can do so by styling it in your MediaWiki:Common.css wiki page (which gets added to CSS for all skins used, see an example of such page on Wikipedia). Something along the lines of this might work:

#toc { position: absolute; top: 2em; right: 0.5em; };