Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. <html xmlns="http://www.w3.org/1999/xhtml"
  2. xmlns:th="http://www.thymeleaf.org">
  3. <head>
  4. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
  5. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
  6. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  7. <meta charset="UTF-8">
  8. <title>Testings</title>
  9. </head>
  10. <body>
  11. <table class="table table-bordered table-striped" id="table">
  12. <tr>
  13. <th>Id</th>
  14. <th>First Name</th>
  15. <th>Last Name</th>
  16. <th>Age</th>
  17. <th>Weight</th>
  18. <th>Height</th>
  19. <th>Date of last update</th>
  20. <th>PROFILE</th>
  21. </tr>
  22.  
  23. </table>
  24.  
  25. <style>
  26. table {
  27. border: 2px solid #666;
  28. width: 100%;
  29. }
  30. th {
  31. background: #f8f8f8;
  32. font-weight: bold;
  33. padding: 2px;
  34. }
  35. </style>
  36. <script>
  37. $(document).ready(function(){
  38. $.getJSON(" http://localhost:8080/users", function(data){
  39. var user_data = '';
  40. $.each(data, function(key, value){
  41. user_data += '<tr>';
  42. user_data += '<td>' +value.id+'</td>';
  43. user_data += '<td>' +value.fname+'</td>';
  44. user_data += '<td>' +value.lname+'</td>';
  45. user_data += '<td>' +value.age+'</td>';
  46. user_data += '<td>' +value.weight+'</td>';
  47. user_data += '<td>' +value.height+'</td>';
  48. user_data += '<td>' +value.date+'</td>';
  49. user_data += '</tr>';
  50. });
  51. $('#table').append(user_data);
  52. });
  53.  
  54.  
  55. });"src/main/resources/static"
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62. </script>
  63.  
  64. </body>
  65. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement