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

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -