Help:Advanced formatting of wiki pages: Difference between revisions

Wikispaces>FREEZE
No edit summary
Xenwolf (talk | contribs)
Content was old and only applicable to the Wikispaces, I started to update for the current setup
Line 1: Line 1:
Using CSS and JavaScript, it is possible to have some additional control over the formatting of wiki pages that may not be possible with the tools provided by the standard interface.
Using [[CSS]] and [[JavaScript]] is in theory possible for MediaWiki-based wikis, it has to be configured on the server.


For example, Wikispaces offers few options for formatting tables. Let's say we want to add some padding to a table. The following code, inserted into an "Other HTML" Widget anywhere on the page, should do the trick:
Inline-CSS is possible for all HTML-tags supported by MediaWiki (some have to be first enabled on the server), for example <code>tt</code>, <code>code</code>, <code>pre</code>, <code>div</code>, <code>span</code> etc. can be used whereas <code>a</code> or <code>img</code> can not.


<pre>&lt;script type="text/javascript"&gt;
Use the [[SandBox|sandbox]] for experimentation or start a page in the user namespace, IOW as a subpage of your user page, for example <code>User:Me/Sandbox</code>.
/*&lt;![CDATA[*/
document.write('&lt;style type="text/css"&gt; .wiki_table td { padding: 5px; } &lt;\/style&gt;');
/*]]&gt;*/
&lt;/script&gt;</pre>


Other elements may perhaps be styled in this manner as well. Some trial and error and inspection of the page source will likely be needed to determine the proper ids and classes to use. Use the [[SandBox|sandbox]] for experimentation.
[[Category:wiki_help]]
[[Category:wiki_help]]