Answer the question
In order to leave comments, you need to log in
How to create an editable table on a web page?
I need to organize a web page on which data is loaded from the database into a table and on which I can change them. I write simple python scripts. I was able to organize the output of a data table from the sqlite3 database to a page created using Flask. I do not understand how to organize the addition of new rows to the database by conditionally clicking on the "+" sign in the table.
Answer the question
In order to leave comments, you need to log in
pressing + creates an object that you fill with data
send a POST command to the server /api/users
get an id
every time you change to a new column call PATCH /api/users
When you click on the + button, make it so that the form (tag) is rendered with the table fields (this is done using javascript), well, add the form submit button. In short, read about html form.
How can I help you? Take Django and its tutorial and do it. Throw Flask away into a corner until you learn how to program.
By clicking on + using JS, add tr and td to the page, inside the cells of the field as in the form, then when you click the Save button, the data from this form flies to the database. What's the problem then?
https://www.datatables.net/ I think this is what you need
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question