Jason Jason - 4 years ago 104
HTML Question

use delimiter within ngTable cells

I'm currently using ngTable to build a table that shows a list of email. I would like to use semi-colon as a delimiter to create a new row for every email inside the cell. What would be the best way to approach this?

Id Email
1 group@example.com
2 group1@example.com;group2@example.com;group3@example.com
3 group22@example.com

Goal is to get:
Id Email
1 group@example.com
2 group1@example.com
3 group22@example.com


Answer Source

You could style the td with white-space:pre, split the email by ; and join with 
 (line feed);

<td data-title="'Email'" style="white-space:pre">{{row.group_email.split(";").join("&#10;")}}</td>

updated fiddle

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download