Skip to content
Advertisement

Alpine JS Table Data Binding

I’m a newbie in Alpine JS. I want to design my table with detailed rows like this:

enter image description here

I wrote a simple HTML table like this:

JavaScript

I tried to bind my JSON to this table. At that point, it did not work as expected. Here is what I tried:

JavaScript

With this code, the output will look like this:

enter image description here

User detail fields are building after the total of the list. And there is no data like user email in there. What am I missing? How can I fix this code?

You can access the Codepen project from here.

Any help would be appreciated!

Advertisement

Answer

I’ve been tried to change a few about HTML TABLES, Finally, I reached your the expected result. Here’s the codepen link: codepen

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement