JSFiddle - React, Tailwind, and code Playground

by fresheyeball

HTML

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/css/bootstrap.min.css">
<div>
    Digest time : <span id="time">?</span>
    <button>Update</button>
    <br/>
    <table class="table table-striped">        
        <tbody>
        </tbody>    
    </table>
</div>

CoffeeScript

COLUMNS_LENGTH = 5
ROWS_LENGTH    = 200

$ ->
    rows = []
    $tbody = $ 'tbody'
    update = ->
        rand = Math.floor Math.random() * 5000
        html = ''
        for i in [0...ROWS_LENGTH]
            html += "<tr>"
            html += "<td>cell #{rand} | #{j+1}, #{i+1}</td>" for j in [0...COLUMNS_LENGTH]
            html += "</tr>"
        $tbody.html html
    update()
   
    $('button').on 'click', ->        
        now = Date.now()
        update()
        $('#time').html "#{Date.now()-now}ms"