Advertisement
Nahid8195

final html

Jul 31st, 2021
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <style>
  5. table, th, td {
  6. border: 1px solid black;
  7. }
  8.  
  9. </style>
  10. <title></title>
  11. </head>
  12. <body>
  13. <ul id="users"></ul>
  14. <script src="https://unpkg.com/axios@0.21.1/dist/axios.min.js"></script>
  15. <script>
  16. axios.get('https://jsonplaceholder.typicode.com/users')
  17. .then(function (res) {
  18. res.data.forEach(x => {
  19. document.getElementById('users').innerHTML +=
  20. '<table border="1" >'+
  21. '<tr >'+
  22. '<th>'+ 'Name' + '</th>' +
  23. '<th>' + 'Username' + '</th>' +
  24. '<th>' + 'Email' + '</th>' +
  25. '<th>' + 'Phone Numner' + '</th>' +
  26. '</tr>' +
  27. '<tr >'+
  28. '<td>'+ x.name + '</td>'+
  29. '<td>' + x.username + '</td>' +
  30. '<td>' + x.email + '</td>' +
  31. '<td>' + x.phone + '</td>' +
  32. '</tr>' + '<br>' +
  33.  
  34.  
  35. '</table> '
  36.  
  37. ;
  38. });
  39. })
  40. .catch(function(err){
  41. console.log(err);
  42.  
  43. })
  44. </script>
  45.  
  46. </body>
  47. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement