Или так...
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=windows-1251' />
<script src='http://code.jquery.com/jquery-latest.js'></script>
<!--
<script src="https://code.angularjs.org/1.3.9/angular.min.js"></script>
<script src="https://code.angularjs.org/1.3.9/angular-route.js"></script>
-->
<style type='text/css'>
</style>
<script type='text/javascript'>
window.onload = function() {
var o=document.querySelectorAll('.sum1');
for (var i=0; i<o.length; i++) {
var p=o[i].parentNode;
val=o[i].innerHTML*p.querySelector('.sum2').innerHTML;
p.querySelector('.sumItg').innerHTML=val
};
};
</script>
</head>
<body>
<table class="table table-bordered">
<thead>
</thead>
<tbody>
<tr>
<td class="text-center">17-И</td>
<td>Устройство натяжного потолка из ПВХ</td>
<td class="text-center">м2</td>
<td class="sum1 text-center">2</td>
<td class="sum2 text-center">2</td>
<td class="sumItg text-right"></td>
</tr>
<tr>
<td class="text-center">17-И</td>
<td>Устройство натяжного потолка из ПВХ</td>
<td class="text-center">м2</td>
<td class="sum1 text-center">2</td>
<td class="sum2 text-center">3</td>
<td class="sumItg text-right"></td>
</tr>
</tbody>
</table>
<span id="parent"></span>
</body>
</html>
Сообщение от Вадим Вадимыч
|
в java полный ноль
|
Это не Java... Это JavaScript.