I have a page that lists output from the database. I am using a div
tag to list the output of each row. I would like to have only ten items outputted on a page, so I will be adding "next" and "previous" buttons to page the results. I don't necessarily want to refresh the whole browser window, just the div
section. Is there a way to do this using only HTML and CSS? My code is below. I am developing using Node.js, thanks.
app.js
router.get('/profile', function(req, res, next) {
db.query('SELECT city_name, state_name, party_name, price, image, address, full_name FROM register natural join party where userid = id', function (err, rs) {
if(!err){
res.render('profile', {party: rs});
}
else{
res.send(err);
}
});
});
profile.ejs
<section class="gallery">
<div class="prices">
<h4>Search Results</h4>
<% party.forEach(function(item) { %>
<div class="img">
<img src="/<%= item.image %>" alt="image">
<div class="description">
<h2>
<%= item.party_name %>
</h2>
<h6>Host:
<%= item.full_name %>
</h6>
<h5>Address:
<%= item.address %>,
<%= item.city_name %>,
<%= item.state_name %>
</h5>
<h3>Price:
<%= item.price %>
</h3>
</div>
</div>
<% }); %>
</div>
<hr>
</section>