html - How to wrap comma separated string onto new line in td cell? -
i've 1 column in table contains comma separated emails in each cell of column.
so example cell may contain following , cell displays email inline. instead of breaking second email onto newline:
jdoe@gmail.com,bgates@outlook.com
question:
how can wrap comma separated strings onto new line in td cell?
what i've tried:
i can't statically set <br/>
between emails being read database dynamically.
i did try adding span within td , applying custom css style wrap-emails
. style doesn't display emails stacked expected in cell:
css style:
span.wrap-emails { word-wrap:break-word }
cell definition:
<td><span class="wrap-emails">@row.contact_emails</span></td>
you should able replace commas br
s using following in razor:
@html.raw(row.contact_emails.replace(",","<br>"))
the html.raw
bit renders br
instead of encoding it
Comments
Post a Comment