how to display and show html code on a web page
When i first started my blog i wanted to "post the programming tutorial", so i started writing the codes but whenever i preview the post. The programming gets executed every time. I tried many tricks but every thing failed.
Then i started researching for the same. I found that there are some other blogger who faced the same issue and i am giving you the details below that what you can do for getting the required result.
If you want to
display and show HTML code on a web page so that it is
not executed, you need to
convert the < and > into it's
ascii equivalent of < and > this can be very time consuming
especially it is a large block of code that you wish to display within a web
page tutorial that you are writing.
Here is an Example Conversion
Let us suppose you are trying to
explain to someone the HTML code for adding a table into a web page and that
code is below:
However, if you just added the code above it would be executed as soon as the page was viewed, which is defeating what you are trying to explain to your visitors, so we need to be able to display the < and > in ascii mode to prevent execution of the code.
What you will need to do is copy and then paste the code into the top box on this page, next, by clicking the "Convert Code" button you will be presented with the code below.
<table width="300" border="1" cellpadding="2" cellspacing="2" bgcolor="#ffffff">
<tr valign=top>
<td>
</td>
<td>
</td>
</tr>
<tr valign=top>
<td>
</td>
<td>
</td>
</tr>
</table>