JSFiddle - React, Tailwind, and code Playground

jsrender 1.0p.20 Single dimensional array Demo

by shk2469

HTML

<!-- as of 7-25-2012 
jsrender single dimensional array demo
-->

<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="http://borismoore.github.com/jsrender/jsrender.js"></script>

<script id="DataTemplate" type="text/x-jsrender">    
<table>
    <tbody>        
        <tr>
            <td>{{:#index}}</td>
            <td class="sequenceColumn">          
                <div id="{{:#data}}">{{:#data}}</div>                        
            </td>
        </tr>
        
    </tbody>
</table>
</script>

<div id="ParentContainer"></div>

CSS

body { font-family: Candara; }
table { border: 1px solid black; }
td {  border: 1px solid black; padding: 4px; }
td:first-child { font-weight: bold; width: 20px; }
td:last-child { color: red; width: 40px; }

JavaScript

$(function () {
    var data = [951,753,651,741,852,963];                
    $("#ParentContainer").html($("#DataTemplate").render(data));
});