Jump to content

How to don't parse HTML in HTML


Norman

Recommended Posts

Mhh, if I want to show an html code to visitors, what should I write in a HTML page? I mean.. If I write:<table border="1"><tr><td>This is my code. </td></tr></table>I get a table. I want to show the code! How can I do? :)

Link to comment
Share on other sites

Use HTMl entities - > = > , < = < , " = ". so

<table border="1"><tr><td>This is my code. </td></tr></table>

Link to comment
Share on other sites

Or you could make a serverside script that holds the html you want shown as code on the page in a variable, and then runs that variable through a string-replace function, replacing "<" with "<" and ">" with ">". That way, it's easier to change the html and easier to write into the document as well. :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...