<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 iscrizione"></mds-table-header-cell> </mds-table-header> <mds-table-body> <mds-table-row> <mds-table-cell><mds-text typography="detail">Mario Rossi</mds-text></mds-table-cell> <mds-table-cell><mds-text typography="detail">mario.rossi@example.com</mds-text></mds-table-cell> <mds-table-cell><mds-text typography="detail">12 ottobre 1985</mds-text></mds-table-cell> </mds-table-row> <mds-table-row> <mds-table-cell><mds-text typography="detail">Luigi Verdi</mds-text></mds-table-cell> <mds-table-cell><mds-text typography="detail">luigi.verdi@example.com</mds-text></mds-table-cell> <mds-table-cell><mds-text typography="detail">3 marzo 1993</mds-text></mds-table-cell> </mds-table-row> </mds-table-body></mds-table><div class="flex"> <aside class="w-6400 shrink-0">...</aside> <main class="min-w-0 flex-1"> <mds-table class="w-full [&_mds-table-cell]:text-nowrap [&_mds-text]:text-nowrap"> <mds-table-header> <mds-table-header-cell label="Protocollo"></mds-table-header-cell> <mds-table-header-cell label="Oggetto"></mds-table-header-cell> <mds-table-header-cell label="Ufficio"></mds-table-header-cell> <mds-table-header-cell label="Data"></mds-table-header-cell> </mds-table-header> <mds-table-body> <mds-table-row> <mds-table-cell><mds-text typography="detail">2026/0412</mds-text></mds-table-cell> <mds-table-cell><mds-text typography="detail">Contratto di fornitura servizi cloud 2026-2028</mds-text></mds-table-cell> <mds-table-cell><mds-text typography="detail">Ufficio acquisti e gare</mds-text></mds-table-cell> <mds-table-cell><mds-text typography="detail">12 marzo 2026</mds-text></mds-table-cell> </mds-table-row> </mds-table-body> </mds-table> </main></div><section class="flex h-9600 flex-col"> <mds-table class="min-h-0 flex-1 [&_mds-table-cell]:text-nowrap [&_mds-text]:text-nowrap"> ... </mds-table></section>.content { min-width: 0;}
.content mds-table { width: 100%;}
.content mds-table-cell,.content mds-table-cell mds-text { text-wrap: nowrap;}<mds-table> <mds-table-header> <mds-table-header-cell label="Voce"></mds-table-header-cell> <mds-table-header-cell label="Importo"></mds-table-header-cell> </mds-table-header> <mds-table-body> <mds-table-row> <mds-table-cell><mds-text typography="detail">Servizio A</mds-text></mds-table-cell> <mds-table-cell><mds-text typography="detail">120,00 EUR</mds-text></mds-table-cell> </mds-table-row> <mds-table-row> <mds-table-cell><mds-text typography="detail">Servizio B</mds-text></mds-table-cell> <mds-table-cell><mds-text typography="detail">80,00 EUR</mds-text></mds-table-cell> </mds-table-row> </mds-table-body> <mds-table-footer> <mds-table-cell><mds-text typography="action">Totale</mds-text></mds-table-cell> <mds-table-cell><mds-text typography="action">200,00 EUR</mds-text></mds-table-cell> </mds-table-footer></mds-table><mds-table interactive> <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> <mds-table-cell><mds-text typography="detail">Anna Bianchi</mds-text></mds-table-cell> <mds-table-cell><mds-text typography="detail">Amministratore</mds-text></mds-table-cell> </mds-table-row> <mds-table-row> <mds-table-cell><mds-text typography="detail">Carlo Neri</mds-text></mds-table-cell> <mds-table-cell><mds-text typography="detail">Operatore</mds-text></mds-table-cell> </mds-table-row> </mds-table-body></mds-table><mds-table interactive> <mds-table-header> <mds-table-header-cell label="Documento"></mds-table-header-cell> <mds-table-header-cell label="Stato"></mds-table-header-cell> </mds-table-header> <mds-table-body> <mds-table-row> <mds-table-cell><mds-text typography="detail">Contratto 2024.pdf</mds-text></mds-table-cell> <mds-table-cell><mds-text typography="detail">Approvato</mds-text></mds-table-cell> <mds-button slot="action" icon="mi/baseline/download" title="Scarica documento" variant="dark" tone="text" ></mds-button> <mds-button slot="action" icon="mi/baseline/delete" title="Elimina documento" variant="error" tone="text" ></mds-button> </mds-table-row> </mds-table-body></mds-table><mds-table selectable id="tabella-utenti"> <mds-table-header> <mds-table-header-cell label="Nome"></mds-table-header-cell> <mds-table-header-cell label="Reparto"></mds-table-header-cell> </mds-table-header> <mds-table-body> <mds-table-row value="usr-001"> <mds-table-cell><mds-text typography="detail">Giulia Russo</mds-text></mds-table-cell> <mds-table-cell><mds-text typography="detail">Contabilita</mds-text></mds-table-cell> </mds-table-row> <mds-table-row value="usr-002"> <mds-table-cell><mds-text typography="detail">Marco Ferrari</mds-text></mds-table-cell> <mds-table-cell><mds-text typography="detail">IT</mds-text></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); // e.detail.rows => [{ index: 0, value: 'usr-001' }, ...] });</script><mds-button id="btn-seleziona-tutti" label="Seleziona tutti" variant="primary" tone="outline"></mds-button><mds-button id="btn-deseleziona" label="Deseleziona tutti" variant="dark" tone="text"></mds-button>
<mds-table selectable id="tabella-doc"> <mds-table-header> <mds-table-header-cell label="Titolo"></mds-table-header-cell> </mds-table-header> <mds-table-body> <mds-table-row value="doc-1"> <mds-table-cell><mds-text typography="detail">Verbale assemblea</mds-text></mds-table-cell> </mds-table-row> <mds-table-row value="doc-2"> <mds-table-cell><mds-text typography="detail">Bilancio 2024</mds-text></mds-table-cell> </mds-table-row> </mds-table-body></mds-table>
<script> const table = document.getElementById('tabella-doc'); document.getElementById('btn-seleziona-tutti').addEventListener('click', () => table.selectAll()); document.getElementById('btn-deseleziona').addEventListener('click', () => table.selectAll(false));</script><mds-table selectable> <mds-table-header> <mds-table-header-cell label="Pratica"></mds-table-header-cell> <mds-table-header-cell label="Stato"></mds-table-header-cell> </mds-table-header> <mds-table-body> <mds-table-row value="prat-001"> <mds-table-cell><mds-text typography="detail">Pratica n. 1234</mds-text></mds-table-cell> <mds-table-cell><mds-text typography="detail">In lavorazione</mds-text></mds-table-cell> </mds-table-row> <mds-table-row value="prat-002"> <mds-table-cell><mds-text typography="detail">Pratica n. 5678</mds-text></mds-table-cell> <mds-table-cell><mds-text typography="detail">Chiusa</mds-text></mds-table-cell> </mds-table-row> </mds-table-body> <mds-button slot="batch-action" icon="mi/outline/send" label="Invia selezionati" variant="dark" tone="text" ></mds-button> <mds-button slot="batch-action" icon="mi/outline/delete" label="Elimina selezionati" variant="error" tone="text" ></mds-button></mds-table><mds-table id="practices" sorting="external"> <mds-table-header> <mds-table-header-cell label="Numero" sortable sort-key="number"></mds-table-header-cell> <mds-table-header-cell label="Ricevuta il" sortable sort-key="received"></mds-table-header-cell> <mds-table-header-cell label="Oggetto"></mds-table-header-cell> </mds-table-header> <mds-table-body> <!-- the rows of the current page, rendered by the application --> </mds-table-body></mds-table><mds-paginator id="pages" pages="12"></mds-paginator>const table = document.querySelector('#practices');const pages = document.querySelector('#pages');
table.addEventListener('mdsTableHeaderCellSort', async (event) => { const { sortKey, direction } = event.detail; // direction "none" asks for the order of the back end await loadPage({ page: 1, sort: direction === 'none' ? undefined : { sortKey, direction } }); pages.currentPage = 1;});.tabella-contratti mds-table { --mds-table-background: rgb(var(--magma-surface-raised)); --mds-table-background-alt: rgb(var(--magma-surface-muted)); --mds-table-border-color: rgb(var(--magma-accent-border)); --mds-table-border-width: 1px; --mds-table-cell-padding: calc(var(--spacing) * 500); --mds-table-color: rgb(var(--magma-text-default));}