Norman Posted November 9, 2007 Share Posted November 9, 2007 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 More sharing options...
Synook Posted November 9, 2007 Share Posted November 9, 2007 Use HTMl entities - > = > , < = < , " = ". so <table border="1"><tr><td>This is my code. </td></tr></table> Link to comment Share on other sites More sharing options...
Jonas Posted November 9, 2007 Share Posted November 9, 2007 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 More sharing options...
Reg Edit Posted November 9, 2007 Share Posted November 9, 2007 You may also find the <pre> tag useful. View source of this for an example of some html rendered in amongst text. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.