Put code examples inside pre tags the pre stands for preformatted text. This will preserve the formatting of the text you entered (example tab, double spaces, new lines).
<pre>
<code>
<pre>
text
tab tab tab
double space double space
</pre>
</code>
</pre>