Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:th="http://www.thymeleaf.org">
- <head>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
- <meta charset="UTF-8">
- <title>Testings</title>
- </head>
- <body>
- <table class="table table-bordered table-striped" id="table">
- <tr>
- <th>Id</th>
- <th>First Name</th>
- <th>Last Name</th>
- <th>Age</th>
- <th>Weight</th>
- <th>Height</th>
- <th>Date of last update</th>
- <th>PROFILE</th>
- </tr>
- </table>
- <style>
- table {
- border: 2px solid #666;
- width: 100%;
- }
- th {
- background: #f8f8f8;
- font-weight: bold;
- padding: 2px;
- }
- </style>
- <script>
- $(document).ready(function(){
- $.getJSON(" http://localhost:8080/users", function(data){
- var user_data = '';
- $.each(data, function(key, value){
- user_data += '<tr>';
- user_data += '<td>' +value.id+'</td>';
- user_data += '<td>' +value.fname+'</td>';
- user_data += '<td>' +value.lname+'</td>';
- user_data += '<td>' +value.age+'</td>';
- user_data += '<td>' +value.weight+'</td>';
- user_data += '<td>' +value.height+'</td>';
- user_data += '<td>' +value.date+'</td>';
- user_data += '</tr>';
- });
- $('#table').append(user_data);
- });
- });"src/main/resources/static"
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement