vendredi 27 février 2015

How to structure tags for a table where each row is a form?

I have to create a page with a table, where each row of data is modifiable and can be saved directly by editing the table (think of something like what phpMyAdmin does to allow you to edit a table inline). I have several options before me and I am wondering which is the more semantically correct:



  • Create a giant <form> wrapping my <table> where each row containing several <input>s is a child of the same giant <form>

  • Create a <table> where each row is a separate <form>


I would be linking every <input> to a Javascript callback so that the updates are sent to the server automatically every time you change a row. Which route is most in line with the HTML 5 specs?


Aucun commentaire:

Enregistrer un commentaire