creating large element in js

Solutions on MaxInterview for creating large element in js by the best coders in the world

showing results for - "creating large element in js"
Antonio
19 Mar 2017
1var tableElementContainer1 = document.getElementById("employeeListContainer1"),
2    temptableHolder  = '<table><thead><tr><th>First Name</th><th>Last Name</th><th>Title</th><th>ID</th><th>Department</th></tr></thead><tbody>';
3        for(var i=0,len=testData.length; i<len; i++){
4                temptableHolder  += '<tr><td>' + testData[i].firstName + '</td><td>' + testData[i].lastName + '</td><td>' + testData[i].title
5                        + '</td><td>' + testData[i].id + '</td><td>'  + testData[i].department +  '</td></tr>';
6            }
7    temptableHolder += '</tbody></table>';
8    tableElementContainer1.innerHTML  = temptableHolder ;