export default class TableHeader { constructor(columns) { this.columns = columns; } render() { const tr = document.createElement('tr'); const colgroup = document.createElement('colgroup'); this.columns.forEach((column) => { const th = document.createElement('th'); const col = document.createElement('col'); th.setAttribute('data-column', column.column); col.setAttribute('data-column', column.column); th.innerHTML = column.label tr.appendChild(th); colgroup.appendChild(col); }); const thead = document.createElement('thead'); thead.appendChild(tr); return {colgroup : colgroup, thead : thead }; } }