i have a table into which i need to add rows by counting the number of elements i have in my object in javascript.I have an object that has normal keys and an array of values.
userobject={
ID: [1,2,3]
IP_Address: ["12.21.12.321","52.23.12.312","12.32.12.321"]
Server_Name: ["test1","test2","test3"]}
This is how my object looks like.I need to add each element in the array into a column on each row in the table. How can i automatically generate this.
ID| IP ADDRESS |SERVERNAME|
1 | 12.21.12.321| test1 |
2 | 52.23.12.312| test2 |
3 | 12.32.12.321| test3 |
and so on.
Data needs to be inserted from the array of values into each row.I have already created the table header i.e.column names.
i just need help to insert each value one by one into each row.And also if a person wants to delete a row
a row has to be deleted based on the number of elements in the array.
Can someone please help me!?