建立5列的表下面是我的JSON響應如何使用jQuery模板JSON響應
"Table" : [
{
"CompanyName" : "Company1",
"Title" : "xxx",
"URL" : "http://www.xyz.com",
"FileNameStatus" : "active"
},
{
"CompanyName" : "Company2",
"Title" : "xxx",
"URL" : "http://www.xyz1.com",
"FileNameStatus" : "inactive"
},
...
$("#tableTemplate").tmpl(data.Table).appendTo("#tblid");
<script id="tableTemplate" type="text/x-jquery-tmpl">
<tr>
<td>
<a href="${URL}" target="_blank">
<img src="${FileNameStatus}.jpg" title="${Title}" />
</a>
</td>
</tr>
</script>
<div id="rightWrapper">
<table id="tblid">
</table>
</div>
我尋找是建立一個表5列和n行(列水平重複)。
eg:
col1 col2 col3 col4 col5
col6 col7 col8 col9 col10
col11 col12 col13
.....
....
如何用上面的數據結構和jQuery模板構建這樣的表? 在此先感謝。
謝謝!這有幫助。 – Firknl 2011-03-08 11:12:57