I would like to change all the values of a column in a table every time I get a new value. For this, I have a JS code (JQuery) and an HTML code. JQuery allows me to replace values with ".replaceWith". However, instead of replacing all the time values, it displays me one by one. First column = time 1, second column = time 2 etc. Would it be possible to do this differently without having to declare a new ID for each row? Thanks a lot.
(The CSS is not done yet, sorry for the questionable readability)
JS CODE
content2 = '<td>' + epochToDateTime(timestamp) + '</td>';
$('#tbody2').replaceWith(content2);
content3 = '<td>' + Com_success_rate + '</td>';
$('#tbody3').replaceWith(content3);
content4 = '<td>' + PLC_communication_failure + '</td>';
$('#tbody4').replaceWith(content4);
HTML CODE
<tr>
<td></td>
<td>%D3 id= </td>
<td>ALM_LOCAL_COM@1</td>
<td>PLC communication failure</td>
<td id="tbody4"></td>
<td id="tbody2"></td>
</tr>
<tr>
<td></td>
<td>%DW4 id= </td>
<td>LOCAL_COM_RATE@1</td>
<td>Com success rate</td>
<td id="tbody3"></td>
<td id="tbody2"></td>
</tr>
And what I get in the website : Table