Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. function table(input){
  2. let html = '<table>\n';
  3.  
  4. for (let i = 0; i < input.length; i++) {
  5. let currJson = JSON.parse(input[i]);
  6. html += `\t<tr>\n`;
  7. html += `\t\t<td>${currJson.name}</td>\n`;
  8. html += `\t\t<td>${currJson.position}</td>\n`;
  9. html += `\t\t<td>${currJson.salary}</td>\n`;
  10. html += `\t</tr>\n`;
  11. }
  12.  
  13. html += `</table>`;
  14.  
  15. return html;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement