Table binding

This example shows how to bind data to a table.

<script type="text/template" id="myTemplate">
    <table class="table" id="table">
        <thead>
            <tr>
                #for(let col of columns) {#
                <th>#col#</th>
                #}#
            </tr>
        </thead>
        <tbody>
            #for(let row of rows) {#
            <tr>
                <td>#row#</td>
                <td>#row#</td>
                <td>#row#</td>
            </tr>
            #}#
        </tbody>
    </table>
</script>
<div id="output"></div>

<script src="https://cdn.jsdelivr.net/gh/richdafunk/hashJS@v1.3.1/hashJS.js"></script> 
<script>
    const data = {
        columns: ["Column 1", "Column 2", "Column 3"],
        rows: ['Item 1', 'Item 2', 'Item 3']
    };

    var h = new hashJS("myTemplate", data, "output");
    h.bind(data);
</script>
Output result: