How to render a cell as plain text rather than as HTML?

How to render a cell as plain text rather than as HTML?

pauldb126pauldb126 Posts: 1Questions: 0Answers: 0
edited March 2012 in General
Hi,
I need to be able to render a cell as plain text so that if it includes HTML tags, it is not rendered as HTML.

For example, I need:
Hello
to show the tags.

I'm trying to do it without substituting '&lt' for '<' and '&gt' for '>' if possible.

Is there anything in which the remdering type can be specified for a column?
Thanks,
-Paul

Replies

  • allanallan Posts: 63,214Questions: 1Answers: 10,415 Site admin
    You need to do the substitution (if you are table is being generated by a server-side script somewhere, most languages have a method to escape HTML entities). DataTables will write the cell contents with innerHTML, so if you what it to show up with HTML entities escaped, your need to escape HTML entities :-)

    Allan
This discussion has been closed.