Tell me more ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

According to the MediaWiki FAQ

A TOC is added automatically as soon as you have more than three headers.

which is fine and all, but I'd like it floated to the right, so that it does not take up a lot of vertical space at the top of the page.

How can I float the table of contents to the right?

share|improve this question

4 Answers

up vote 4 down vote accepted

Add

#toc { float: right };

to your MediaWiki:Common.css wiki page.

share|improve this answer
Brilliant! Thank you. – Robert Munteanu Jul 16 '10 at 10:46
1  
For any noobs out there (like me), you can access this special page just like any other, with an URL like this: my.domain.com/MediaWiki/index.php?title=MediaWiki:Common.css – Jon of All Trades Mar 3 at 5:41
...or by writing the name to site's search box. – che Mar 5 at 11:30

For one page use

<div style="float:right;">__TOC__</div>

This is what I usually do. Being that I do a lot with styling and so forth, I hate using my user css to modify anything since then I don't see what everyone else sees and therefore don't know what a visitor will see.

share|improve this answer

If you just want to do it for one particular page and not all pages the following WikiMarkup should work (source):

{| align="right"
| __TOC__
|}
share|improve this answer

Try using this in the Mediawiki:common.css file

#toc {float:right;margin:0 0 1em 1em;position:fixed;top:150px;right:10px;};

This not only places the floating TOC to the right, but also keeps it visible all the time while scrolling up and down the page.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.