Edit This Code:
<!DOCTYPE html>
<html>
<link rel="stylesheet" href="../lib/w3.css">
<script src="../lib/w3data.js"></script>
<script>
var myObject = {"customers":[
{"CustomerName":"Alfreds Futterkiste","Color":"w3-red"},
{"CustomerName":"Ana Trujillo Emparedados y helados","Color":"w3-blue"},
{"CustomerName":"Antonio Moreno Taquería","Color":"w3-teal"},
{"CustomerName":"Around the Horn","Color":"w3-yellow"},
{"CustomerName":"B's Beverages","Color":"w3-green"}
]};
</script>

<body>

<table id="id01" class="w3-table">
  <tr w3-repeat="customers" class="{{Color}}">
    <td>{{CustomerName}}</td>
  </tr>
</table>

<script>
w3DisplayData("id01", myObject);
</script>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy