Dynamically add 10 table rows to table and populate data

Hi

I have some JavaScript code where I load the page and dynamically add 11 rows to the table

http://ectpro.co/test/test.html

How do I populate data iinto these columns?
Not sure how to reference the fields.

If someone could look at what I’ve done so far and help me out on how to add the data - much appreciated.

You reference the <tbody> tags in the table using .tBodies then within that you reference the rows using .rows and then within that the cells can be referenced using .cells.

The table tag of your table has id=“dataTable” so to reference the fourth cell in the third row of the tbody of your table you’d specify

document.getElementById(‘dataTable’).tBodies[0].rows[2].cells[3]

With the way you have the table defined this would be the pricecell on the Starter Pack row.

If you put the heading row into the thead where it belongs then to reference the same cell you’d need to reference rows[1] instead of rows[2] because then the tow row would be in the .htead and mor in the .tbodies[0] section of the table.