There is a table:

<tr class="odd gradeX panel panel-default info"> <td>1</td> <td>2</td> <td>2</td> <td>3</td> <td>8</td> <td>7</td> <td>6</td> <td>5</td> </tr> 

in the plate of 7 columns it is necessary that the data be inserted into it one by one into each <td> came from the server in JSON format, here is json itself:

 {1:новоеЗначение, 2:новоеЗначение, 3:новоеЗначение, 4:новоеЗначение, 5:новоеЗначение, 6:новоеЗначение, 7:новоеЗначение} 

    1 answer 1

    We iterate over the children property:

     let tr = document.querySelector('.odd'), json = JSON.parse`{"1": "One", "2": "Two", "3": "Three", "4": "Four", "5": "Five", "6": "Six", "7": "Seven", "8": "Eight"}`; Array.from(tr.children).forEach((td, i) => td.innerHTML = json[i + 1]); 
     <table> <tr class="odd gradeX panel panel-default info"> <td>1</td> <td>2</td> <td>2</td> <td>3</td> <td>8</td> <td>7</td> <td>6</td> <td>5</td> </tr> </table> 

    • Can you do it on jQuery? - rodgers
    • @other thanks and on this one! - rodgers
    • @rodgers, it is very easy to remake in the liquid, but why, if it works natively and that way? - user207618
    • yes thanks I already redid it, I just didn’t know the native functions of these, but I uncovered it - rodgers