function initTableau() { const tbody = document.querySelector( '#table-facture' ).querySelector( 'tbody'); for ( let i = 0; i < activites.length; i++ ) { const ligne = tbody.insertRow(); // cellules activités let cellActivite = ligne.insertCell(); cellActivite.innerHTML = activites[ i ].titre; cellActivite.className = 'lib-acti'; // cellules cotisations let cellCotisation = ligne.insertCell(); cellCotisation.innerHTML = euro.format( activites[ i ].prix ); cellCotisation.className = 'fld-num'; // cellules choix let cellChoix = ligne.insertCell(); cellChoix.className = 'fld-log'; if ( i === activites.length -1 ) { // dernière ligne, les frais sont obligatoires (frais d'adhésions) cellChoix.innerHTML = ''; } else { cellChoix.innerHTML = ''; } // cellules prix cellTarif = ligne.insertCell(); cellTarif.innerHTML = euro.format( 0 ); cellTarif.className = 'fld-num'; } }