display html

liunx

Guest
how do I display text as is...<br />
<br />
meaning if I want the browser to display the following:<br />
<br />
"<table><br />
<tr><br />
<td>Mac</td><br />
</tr><br />
</table>"<br />
<br />
Basically Im trying to display some HTML, but the browser keeps rendering it.?<br />
What to do?<!--content-->type:<br />
<br />
< for <<br />
> for ><!--content-->Like whkoh said,<br />
<br />
you need to use the character entity for the brackets to make them display, see his post for the code.<br />
<br />
What I do if I wanted to display lots of html code is use a text editor and use "search and replace" to replace brakets with the code.<br />
<br />
If you wanted to display a whole page of HTML code you can put this tag in the page <plaintext> and all HTML code will display. <br />
<br />
Kevin<!--content-->Originally posted by kevin <br />
If you wanted to display a whole page of HTML code you can put this tag in the page <plaintext> and all HTML code will display.<br />
I don't recommend <plaintext>. I tested it in IE and <plaintext> doesn't allow HTML tags below it. So, the rest of your page will be affected by the <plaintext> tag.<!--content-->doesn't the <pre> tag do something like that?<!--content-->Originally posted by kevin <br />
If you wanted to display a whole page of HTML code you can put this tag in the page <plaintext> and all HTML code will display. <br />
<br />
you're correct, there is no closing tag for <plaintext> which is why you would use it for a whole page (great to use on HTML enabled chat/message boards ifyaknowwhatimean) :D<br />
<br />
Kevin<!--content-->Originally posted by scoutt <br />
doesn't the <pre> tag do something like that? <br />
<br />
Not the pre tag (which uses monospace and retains white space but does render HTML code) but there are other tags you can use, I just don't remember them off the top of my head! ;)<br />
<br />
Kevin<!--content--><xmp><br />
<table> <br />
<tr> <br />
<td>Mac</td> <br />
</tr> <br />
</table> <br />
<br />
</xmp><br />
<br />
xmp is a depreciated but still support tag. Itreats everything between <xmp> and </xmp> as a literal string for the purpose of rendering<!--content-->when I want to display the html code (especially for coying) I put it into a textarea. See my example below, please excuse the lack of graphics and all. It was an old page, which is never used. <br />
<br />
<!-- m --><a class="postlink" href="http://www.volcanic-design.com/developerlibrary/JS/menu_animate.htm">http://www.volcanic-design.com/develope ... nimate.htm</a><!-- m --><!--content-->Originally posted by COBOLdinosaur <br />
<xmp><br />
<table> <br />
<tr> <br />
<td>Mac</td> <br />
</tr> <br />
</table> <br />
<br />
</xmp><br />
<br />
xmp is a depreciated but still support tag. Itreats everything between <xmp> and </xmp> as a literal string for the purpose of rendering <br />
that was the tag I was thinking of, for some reason the <pre> tag came to mind. thanks dino :)<!--content-->You have to be old to remember some of that stuff, that is rarily needed anymore. :drunk:<!--content-->
 
Back
Top