Entwicklerportal
CodeGewölbe
Kostenlose Sammlung für Entwickler, Admins und Website-Betreiber: Snippets, VelinStyle-Komponenten, VelinScript-Automationen und Security-Rezepte — copy-paste-fertig.
Editable Data Table
Was bekomme ich?
HTML
JS
WCAG AA
Sortierbare Tabelle mit Inline-Edit (1.2).
Fortgeschritten
5 Min.
Vorschau
TeamNameCommitsRolleAda42EngineerGrace17Lead
Code
<velin-data-table editable page-size="5" empty-text="Keine Einträge">
<table class="velin-table">
<caption>Team</caption>
<thead>
<tr>
<th data-sort="text">Name</th>
<th data-sort="number">Commits</th>
<th data-sort="none">Rolle</th>
</tr>
</thead>
<tbody>
<tr>
<td data-editable>Ada</td>
<td data-editable>42</td>
<td>Engineer</td>
</tr>
</tbody>
</table>
</velin-data-table>
document.querySelector('velin-data-table')?.addEventListener('velin-data-table-edit', (e) => {
console.log('cell edited', e.detail);
});