Skip to content
Advertisement

Edit a table with Jquery find() then add cell with data from an array with before()

I am trying to insert a column of cells with data from an array. I have tried using a for loop, but that just put all the data of the array in each new cell. My goal is to have the new cells display row_header1, row_header2, or row_header3 respectively.
Can anyone help me with this issue? Thank you.

-for loop I’vs tried.

JavaScript

JavaScript
JavaScript
JavaScript

Advertisement

Answer

I think you need to select the right tr each time when you want to assign value

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