# Creating Tables

**URL:** <https://community.weweb.io/t/creating-tables/138>\
**Category:** How do I?\
**Created:** [December 23, 2021, 9:06am UTC](https://community.weweb.io/t/creating-tables/138 "2021-12-23T09:06:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![argilmour1](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@argilmour1](https://community.weweb.io/u/argilmour1)\
**Post date:** [December 23, 2021, 9:06am UTC](https://community.weweb.io/t/creating-tables/138/1 "2021-12-23T09:06:48Z")

</div>

Is there a simple way to create tables? I have a SQL database with a large number of tables that I need staff to be able to add and update records. Or do I need to create a table view using columns and then a separate pages for adding and updating records.

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [January 3, 2022, 12:53pm UTC](https://community.weweb.io/t/creating-tables/138/2 "2022-01-03T12:53:23Z")

</div>

Hello! Apologies for the late reply, the team took some time off to enter the new year full of energy 🙂

Yes! The simplest way to create tables is to drag and drop the “Table” element in the “Add element” menu:

 ![Screen Shot 2022-01-03 at 13.34.05](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/1X/2cb050ab4085eee5d932fd9e2740baeaa07b308c.png)

Then, inside a columns element, you could add one table and one form for each table you need users to be able to update. In the example below, we want to let users update the mileage of the vehicles that are listed in the table on the left:

 ![Screen Shot 2022-01-03 at 13.32.14](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/1X/60f7717513b788618660ef7b6da8c737dbe0081d.png)

When a user selects a line in the table, you could set a trigger to update a variable called Selected Line:

 ![Screen Shot 2022-01-03 at 13.37.46](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/1X/35e68054c927b2f03045f42600900d00af7b237c.png)

And bind each field of the form to the right info in the Selected Line variable:

 ![Screen Shot 2022-01-03 at 13.41.33](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/1X/3284f3a2621522f0cbf90ff427fd463434a85ad4.png)

Then, you’d create a workflow at form container level and refer to the record ID of the selected line:

 ![Screen Shot 2022-01-03 at 13.46.26](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/1X/fa41c346d8c2a583a8a5179682d870ad51b15bdc.png)

Then you would update your database with the values provided by the user in the form, i.e. the variables associated with each form field:

 ![Screen Shot 2022-01-03 at 13.48.18](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/1X/420d6a7ef967a969ce5e936d0a90c31a52521c73.png)

Finally, you would fetch your collection again at the end of the workflow to ensure that the table on your WeWeb page reflects the latest changes made to the table in your database:

 ![Screen Shot 2022-01-03 at 13.51.16](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/1X/de6b80c509fbdde75e6485bf59c20d5fb5e5627e.png)

Does this help?

We’re planning to record a full video tutorial showing this use case in the coming days so if anything is unclear, please don’t hesitate to let us know! We’ll be more than happy to adjust the tutorial accordingly 🙂

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [February 8, 2022, 3:57pm UTC](https://community.weweb.io/t/creating-tables/138/3 "2022-02-08T15:57:45Z")

</div>

Hello! 👋

Thought you might enjoy these two tutorials 🙂

- how to add the table element in WeWeb and display data from your backend in it (tutorial [here](https://youtu.be/RUUlsUNUAL0))

- how to add a workflow that is pre-filled with the data from the selected line in the table and let’s users make updates to the backend that will dynamically appear in the frontend (tutorial [here](https://youtu.be/eLneDStesI4))

Let me know if there’s anything that’s unclear!
