JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://raw.github.com/janl/mustache.js/0.7.2/mustache.js"></script>
<div id="div-template" style="display:none">
<p>Doesn't work:</p>
<table>
<tr>
{{#numbers}} <th> {{.}} </th> {{/numbers}}
</tr>
</table>
</div>
<script id="script-template" type="text/html">
<p>Works:</p>
<table>
<tr>
{{#numbers}} <th> {{.}} </th> {{/numbers}}
</tr>
</table>
</script>
<div id="div-rendered"></div>
<div id="script-rendered"></div>
JavaScript
var json = {
"numbers": [ 1, 2, 3 ]
};
var divTemplate = Mustache.to_html($('#div-template').html(), json).replace(/^\s*/mg, '');
$('#div-rendered').html(divTemplate);
var scriptTemplate = Mustache.to_html($('#script-template').html(), json).replace(/^\s*/mg, '');
$('#script-rendered').html(scriptTemplate);