JSFiddle - React, Tailwind, and code Playground

by Praveen Kumar Purushothaman

HTML

<input type="text" id="write" />
<div id="console"></div>

CSS

td {border: 1px solid #ccc; margin: 2px; padding: 2px;}

JavaScript

$(document).ready(function(){
    $('#write').bind('keypress', function (e) {
        if (e.keyCode == 13) {
            var $table = $('<table>');
            //tbody
            var $tbody = $table.append('<tbody />').children('tbody');
            // add row
            $tbody.append('<tr />').children('tr:last')
                .append("<td>Router#</td>").append("<td>Column 2</td>");
            // add table to dom
            $table.appendTo('#console');
        }
    });
});