Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<title>W3.JS</title>
<script src="../lib/w3.js"></script>
<body>
<h2>Testing W3.JS in HTML</h2>
<table id="id01">
  <tr>
    <th>Title</th>
    <th>Artist</th>
    <th>Price</th>
  </tr>
  <tr w3-repeat="cd">
    <td>{{title}}</td>
    <td>{{artist}}</td>
    <td>{{price}}</td>
  </tr>
  <tr>
    <td></td>
    <td></td>
    <td>{{total}}</td>
  </tr>
</table>
<script>
w3.getHttpObject("cd_catalog.js", myFunction);
function myFunction(myObject) {
  var i, total = 0;
  var myArray = myObject.cd;
  for (i = 0; i < myArray.length; i++) {
    total += Number(myArray[i].price);
  }
  myObject.total = total.toFixed(2);
  w3.displayObject("id01", myObject);
}
</script>
</body>
<!-- Mirrored from www.mdssup.ma/w3js/tryit.asp?filename=tryw3js_controllers_table by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 05 Sep 2022 14:57:27 GMT -->
</html>