class TableWidget extends HTMLElement { connectedCallback() { const config = JSON.parse(this.getAttribute('config') || '{}'); this.attachShadow({ mode: 'open' }); this.shadowRoot.innerHTML = `
${config.title}
${config.columns.map(col => ``).join('')} ${config.rows.map(row => ` ${row.map(cell => ``).join('')} `).join('')}
${col}
${cell}
`; } } customElements.define('table-widget', TableWidget);