<!-- INCORRECT --><div class="my-list"> <mds-table-row> <mds-table-cell>Mario Rossi</mds-table-cell> </mds-table-row></div>
<!-- CORRECT --><mds-table> <mds-table-body> <mds-table-row> <mds-table-cell><mds-text typography="detail">Mario Rossi</mds-text></mds-table-cell> </mds-table-row> </mds-table-body></mds-table><!-- INCORRECT --><mds-table-row> <td>Mario Rossi</td> <div>mario.rossi@example.com</div></mds-table-row>
<!-- CORRECT --><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-row><!-- INCORRECT --><mds-table> <mds-table-body> <mds-table-row interactive selectable> <mds-table-cell><mds-text typography="detail">Pratica 01</mds-text></mds-table-cell> </mds-table-row> </mds-table-body></mds-table>
<!-- CORRECT --><mds-table interactive selectable> <mds-table-body> <mds-table-row value="p-01"> <mds-table-cell><mds-text typography="detail">Pratica 01</mds-text></mds-table-cell> </mds-table-row> </mds-table-body></mds-table><!-- INCORRECT --><script> document.querySelectorAll('mds-table-row').forEach((row) => { row.addEventListener('click', () => { console.log('selezionato:', row.selected); }); });</script>
<!-- CORRECT --><script> document.querySelector('mds-table').addEventListener('mdsTableSelectionChange', (e) => { console.log('Righe selezionate:', e.detail.rows); });</script><!-- INCORRECT --><mds-table-row> <mds-table-cell><mds-text typography="detail">Documento.pdf</mds-text></mds-table-cell> <mds-button slot="action" icon="mi/baseline/delete" variant="error" tone="text"></mds-button></mds-table-row>
<!-- CORRECT --><mds-table-row> <mds-table-cell><mds-text typography="detail">Documento.pdf</mds-text></mds-table-cell> <mds-button slot="action" icon="mi/baseline/delete" title="Elimina documento" variant="error" tone="text" ></mds-button></mds-table-row>/* INCORRECT */mds-table-row { background-color: rgb(var(--magma-surface-raised)); color: rgb(var(--magma-text-default));}mds-table-row::part(actions) { gap: 4px;}
/* CORRECT */mds-table-row { --mds-table-row-background-alt: rgb(var(--magma-surface-inverse)); --mds-table-row-color-alt: rgb(var(--magma-on-inverse)); --mds-table-row-actions-gap: calc(var(--spacing) * 200);}