dimanche 3 juillet 2016

Better way to create a paginated list of divs

Problem:I need to create a list of "divs" which will contain information regarding hostels (profile picture, a button to book a room there and some short info). This list will be dynamically created through a query to a database. The list should be paginated and only show the first n hostels by making Ajax calls to the db.

My solution: Have a template div created iteratively. Use javascript to implement the pagination requirement.

My question: Does my invent the wheel solution make sense? Or am I better off using some existing library/framework to achieve this if yes any suggestion regarding existing tool would be appreciated (It might be off topic but have failed to find a single library to achieve this).

normal table with one column and three rows

table with one column but splitted rows

Aucun commentaire:

Enregistrer un commentaire