у меня есть список строк и столбцов. в основном столбцы first_value и second_value - это тип ввода, в который пользователь может войти, а столбец total
- это интервал. как я могу добавить столбец first_value и second_value к его строке c? 1002 *
ID| first_value | second value | total
1 0 50 50
2 20 0 20
3 10 0 10
4 20 10 30
5 10 0 10
here is my html/php code
<table class="table table-striped" id="user_set_goal_table" width="100%">
<thead>
<tr>
<th>#</th>
<th>First_value</th>
<th>Second_value</th>
<th>total</th>
</thead>
<tbody>
for($i=1;$i<=16;$i++){
?>
<tr>
<td><?php echo $i; ?></td>
<td><?php echo "<input type='text' class='navigate_TD_ID' id='first_value".$i."' "; ?></td>
<td><?php echo "<input type='text' class='navigate_TD_ID' id='second_value".$i."' "; ?></td>
<td><?php echo "<span id='total".$i." '></span>"?></td>
</tr>
<?php
}
</tbody>
javascript code:
$('.navigate_TD_ID').on('change', function() {
var input_id = $(this).attr('id');
alert(input_id);
});
я уже могу узнать, какой идентификатор пользователь нажимает на TD, но я не знаю, как я реализовать эти расчеты, я имею в виду, как я могу рассчитать и отобразить его в определенную c позицию в строке. любая помощь будет очень признательна.