Christian Rankin
Christian Rankin

Reputation: 13

Add source tags in HTML just as text

I need to display some html/php on my website for the users to see, but not actually run, just show up as text.

I just need something that will work like this below

<table> <div> <p>

Upvotes: 0

Views: 73

Answers (3)

Ali Mohammadi
Ali Mohammadi

Reputation: 1324

for print <table> use &lt;table&gt;

http://www.w3schools.com/html/html_entities.asp

Upvotes: 0

Wayneio
Wayneio

Reputation: 3576

‘&’ (ampersand) becomes ‘&amp;‘
‘"’ (double quote) becomes ‘&quot;‘
”’ (single quote) becomes ‘&#039;‘
‘<’ (less than) becomes ‘&lt;‘
‘>’ (greater than) becomes ‘&gt;‘

In your case

&lt;table&gt; &lt;div&gt; &lt;p&gt;

becomes

<table> <div> <p>

Upvotes: 0

Quentin
Quentin

Reputation: 943939

If you want < to show up as data instead of meaning start of tag, use &lt;. For & use &amp;. Nothing else needs changing in a text node.

Upvotes: 3

Related Questions