br tag inside table data cell - td is not rendered

1.4k views Asked by At

I am using br tag to display a list of strings inside a table cell. But, it is not rendering a newline but is displayed as a tag string.

See column 4,

enter image description here

I tried <BR>, <br/>, </br>, <p>. None of them are printing a newline.

I am using Helvetica Sans-serif font with Jquery-ui, datatables plugin.

I am not using monospaced fonts explicitly anywhere.

1

There are 1 answers

0
AudioBubble On

As Rory said, the table cell content is HTMLEncoded causing this error.

Jquery template encodes the html content when the variables are substituted as,

<td>${var_name}</td>

This was causing the error and i corrected it by using the jquery template - html helper function,

<td>{{html var_name}}</td>

thanks Rory