So I want to <br/> if value is array otherwise just display the value. I guess I can write a function to do this but wondering if there's a better way to do this with jquery template?
<script id="template" type="x-jquery-tmpl"> <table>
<tr>
<td>${name}</td>
<td>{{each value}}${$value}<br/>{{/each}}</td>
</tr> </table>
</script>
<script>
var data = [
{
name: "blah",
value: ["1", "2", "3"]
},
{
name: "blah blah",
value : "abc"
}
];
$('#template').tmpl(data).appendTo('#target);
</script>
<div id="target">
</div>