Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript foreach table

  function get_table(data) {
    let result = ['<table border=1>'];
    for(let row of data) {
        result.push('<tr>');
        for(let cell of row){
            result.push(`<td>${cell}</td>`);
        }
        result.push('</tr>');
    }
    result.push('</table>');
    return result.join('
');
  }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #foreach #table
ADD COMMENT
Topic
Name
2+4 =