I'm fetching data in JSON format from a URL and rendering it to a table, but I need to show only 10 rows per page and I am not sure how to do it
Here is the code to render the data:
const url = "https://gist.githubusercontent.com/bstech-ux/e717b74dbd7cc95a8429eadc83a5c882/raw/ca85214d461ef93c316a47a6770c4b9ba678a6b3/movies.json";
// Get JSON Data and Loop Through Each Object in the Array
$.getJSON(url, (data) => {
// parsePaginationData(data);
let movie_data = "";
// Append Data to movie_data Variable
$.each(data, (key, value) => {
movie_data +=
`<tr>
<td scope="row">${value.id}</td>
<td>${value.title}</td>
<td>${value.director}</td>
<td>${value.distributor}</td>
<td class="rating">${value.imdb_rating}</td>
<td class="votes">${value.imdb_votes}</td>
<td><button type="button" class="btn btn-danger">Delete</button></td>
</tr>`;
});
$('#movies').append(movie_data);
});