Help:Advanced formatting of wiki pages
IMPORTED REVISION FROM WIKISPACES
This is an imported revision from Wikispaces. The revision metadata is included below for reference:
- This revision was by author spt3125 and made on 2014-01-06 21:21:04 UTC.
- The original revision id was 480987530.
- The revision comment was:
The revision contents are below, presented both in the original Wikispaces Wikitext format, and in HTML exactly as Wikispaces rendered it.
Original Wikitext content:
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.
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:
[[code]]
<script type="text/javascript">
/*<![CDATA[*/
document.write('<style type="text/css"> .wiki_table td { padding: 5px; } <\/style>');
/*]]>*/
</script>
[[code]]
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]] for experimentation.Original HTML content:
<html><head><title>Advanced formatting of wiki pages</title></head><body>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.<br />
<br />
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:<br />
<!-- ws:start:WikiTextCodeRule:0:
<pre class="text">&lt;script type=&quot;text/javascript&quot;&gt;<br/>/*&lt;![CDATA[*/<br/>document.write('&lt;style type=&quot;text/css&quot;&gt; .wiki_table td { padding: 5px; } &lt;\/style&gt;');<br/>/*]]&gt;*/<br/>&lt;/script&gt;</pre>
-->
<style type="text/css"><!--
/**
* GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
* (http://qbnz.com/highlighter/ and http://geshi.org/)
*/
.text {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }
-->
</style><pre class="text"><script type="text/javascript">
/*<![CDATA[*/
document.write('<style type="text/css"> .wiki_table td { padding: 5px; } <\/style>');
/*]]>*/
</script></pre>
<!-- ws:end:WikiTextCodeRule:0 --><br />
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 <a class="wiki_link" href="/sandbox">sandbox</a> for experimentation.</body></html>