HTML-тег template задаёт блок HTML, который можно клонировать и вставлять с помощью JavaScript.
Сам статический элемент template не считается частью документа и существует только для того, чтобы им управлял скрипт.
Пример
<h3>Optional Attributes</h3>
<table>
<tr>
<th>Attribute</th>
<th>Description</th>
<th>Possible values</th>
</tr>
<template id="row">
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</template>
</table>
<script>
var template = document.querySelector('#row');
for (var i = 0; i < 4; i += 1) {
var clone = template.content.cloneNode(true);
// data-filling gubbins
template.parentNode.appendChild(clone);
}
</script>Страницы в тему:
Все HTML-теги
a abbr address area article aside audio b base bdi bdo blockquote body br button canvas caption cite code col colgroup data datalist dd del dfn div dl dt em embed fieldset figcaption figure footer form h1 — h6 head header hr html i iframe img input ins kbd keygen label legend li link main map mark meta meter nav noscript object ol optgroup option output p param pre progress q rb rp rt rtc ruby s samp script section select small source span strong style sub sup table tbody td template textarea tfoot th thead time title tr track u ul var video wbr