Love django-tables... but something that I'm sure is trivial to solve is giving me fits. When the value I pass for a given row/column is like:
some<br/>random<br/>words<br/>returned
I want the browser to parse and render the content in that cell... to look like this:
some
random
words
returned
not escape the content I'm passing and display it like this:
some<br/>random<br/>words<br/>returned
Surely there's some flag or option that I've missed?
If some of your data already contains HTML, the simplest solution is to use a
TemplateColumn
rather than a normal column and mark the value as safe:Use mark_safe as follows:
Same question was asked in this thread
HA. Found it. It wasn't django-tables2 that was auto-escaping my content, it was the django templating system itself: https://code.djangoproject.com/wiki/AutoEscaping.
I had to change my template code to render the django-table2 like this: