I
I
igor675632017-12-18 22:38:53
Flask
igor67563, 2017-12-18 22:38:53

How to implement page-by-page (by 5 rows) paging of a table on an HTML page?

On my main.html page, the database is displayed in the form of a table, there are 3 buttons (add\remove\edit rows)
It is necessary to implement pagination of the table, WITHOUT USING PHP
Here is the code for the Users table

db=SQLAlchemy() 

class User(UserMixin,db.Model):
  __tablename__='users'
  
  id = db.Column(db.Integer, primary_key=True,autoincrement=True)
  name = db.Column(db.String, unique=True)
  password=db.Column(db.String)

  def __init__(self, name, password):
    self.name=name
    self.password=password

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
oh, 2017-12-18
well @AnneSmith

datatables flips only on the way
is configured smartly

P
Pavel, 2017-12-19
@toobinks

When requesting data from the database, do offset and limit manually, or using flask_sqlalchemy.
Here is an example .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question