javascript - Missing first html tag in jquery-tmpl -
i trying build table row using jquery-tmpl plugin. these values each cell of row:
var fields = ["a","b","c"]; here template:
<tr> <td>{{= $data}}</td> </tr> the problem template generated is:
<td>a</td> <td>b</td> <td>c</td> but expected result is:
<tr> <td>a</td> <td>b</td> <td>c</td> </tr> the way have found resolve problem add tr tag in javascript, so:
$("<tr>"+htmlgeneratedbytemplate+"</tr>").appendto("#id-of-my-table"); does have same problem?
thank help.
use appendto add list inside tr
<tr id="mylist"></tr> $.tmpl( "mytemplate", movies ).appendto( "#mylist" );
Comments
Post a Comment