JSFiddle - React, Tailwind, and code Playground

by Shashank D

HTML

<script
  src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<table id="table" border="1">
    <thead>
      <tr>
          <th>Date</th>
          <th>Value</th>
      </tr>
    </thead>
    <tbody>
      
    </tbody>
  </table>

JavaScript

new Request.JSON({
	url: "/echo/json",
  data: {
  	json: JSON.encode([
    		{ date: '2012-02-12', value: 5},
        { date: '2011-02-12', value: 10},
      ])
  },
  onSuccess: function (response) {
			response.forEach(function(row) {
      	$('table#table tbody').append("<tr class='tablerow'><td class='col1'>"+row.date+"</td><td class='col2'>"+row.value+"</td></tr>");
      });
  }
}).send();