<mds-table> <mds-table-header> <mds-table-header-cell label="Nome"></mds-table-header-cell> <mds-table-header-cell label="Email"></mds-table-header-cell> <mds-table-header-cell label="Data registrazione"></mds-table-header-cell> </mds-table-header> <mds-table-body> <!-- mds-table-row elements --> </mds-table-body></mds-table><mds-table> <mds-table-header> <mds-table-header-cell sortable label="Cognome"></mds-table-header-cell> <mds-table-header-cell sortable label="Data"></mds-table-header-cell> <mds-table-header-cell label="Note"></mds-table-header-cell> </mds-table-header> <mds-table-body> <!-- mds-table-row elements --> </mds-table-body></mds-table><mds-table selectable> <mds-table-header> <mds-table-header-cell label="Utente"></mds-table-header-cell> <mds-table-header-cell label="Ruolo"></mds-table-header-cell> </mds-table-header> <mds-table-body> <mds-table-row value="1"> <mds-table-cell>Mario Rossi</mds-table-cell> <mds-table-cell>Amministratore</mds-table-cell> </mds-table-row> <mds-table-row value="2"> <mds-table-cell>Giulia Bianchi</mds-table-cell> <mds-table-cell>Editor</mds-table-cell> </mds-table-row> </mds-table-body></mds-table><mds-table selectable id="tabella-utenti"> <mds-table-header> <mds-table-header-cell label="Utente"></mds-table-header-cell> <mds-table-header-cell label="Stato"></mds-table-header-cell> </mds-table-header> <mds-table-body> <mds-table-row value="alice"> <mds-table-cell>Alice Verdi</mds-table-cell> <mds-table-cell>Attivo</mds-table-cell> </mds-table-row> <mds-table-row value="bob"> <mds-table-cell>Bob Neri</mds-table-cell> <mds-table-cell>Sospeso</mds-table-cell> </mds-table-row> </mds-table-body></mds-table>
<script> document.getElementById('tabella-utenti').addEventListener('mdsTableSelectionChange', (e) => { console.log('Righe selezionate:', e.detail.rows); });</script><mds-table> <mds-table-header> <mds-table-header-cell label="Documento"></mds-table-header-cell> <mds-table-header-cell label="Dimensione"></mds-table-header-cell> </mds-table-header> <mds-table-body> <mds-table-row> <mds-table-cell>Relazione annuale.pdf</mds-table-cell> <mds-table-cell>2,4 MB</mds-table-cell> <mds-button slot="action" icon="mi/baseline/download" title="Scarica" variant="primary" tone="text" ></mds-button> </mds-table-row> </mds-table-body></mds-table><mds-table selectable> <mds-table-header> <mds-table-header-cell label="Nome file"></mds-table-header-cell> <mds-table-header-cell label="Tipo"></mds-table-header-cell> </mds-table-header> <mds-table-body> <mds-table-row value="doc1"> <mds-table-cell>contratto.pdf</mds-table-cell> <mds-table-cell>PDF</mds-table-cell> </mds-table-row> <mds-table-row value="doc2"> <mds-table-cell>allegato.docx</mds-table-cell> <mds-table-cell>Word</mds-table-cell> </mds-table-row> </mds-table-body> <mds-button slot="batch-action" label="Elimina selezionati" variant="error" tone="text"></mds-button> <mds-button slot="batch-action" label="Esporta" variant="primary" tone="outline"></mds-button></mds-table>mds-table-header::part(actions) { text-align: center; min-width: 8rem;}