JSFiddle - React, Tailwind, and code Playground

by George Batt

HTML

<table id="table" class="table table-bordered">
     <thead>
        <tr >
           <th class="text-center">Word</th>
        </tr>
     </thead>                       
     <tbody align="center" >
         <tr><td></td></tr>
     </tbody>
</table>

JavaScript

var str = 'word another foo bar';
var words = str.split(" ");

var rows = $.map(words,function(v){
   return $('<tr><td>'+v+'</td></tr>');
});
$('#table tbody').append(rows);