JSFiddle - React, Tailwind, and code Playground
by ph34r
HTML
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" href="//cdn.datatables.net/plug-ins/1.10.7/integration/jqueryui/dataTables.jqueryui.css">
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="//cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js"></script>
JavaScript
// Create container that I want the table to fill
var exampleContainer = $("<div style='height:500px;'/>");
// Will eventually be datatable
var exampleTable = $("<table style='height: 100%;'><thead><tr><th>test column</th></tr></thead></table>");
// Add table to container & container to body
exampleContainer.append(exampleTable);
$("body").append(exampleContainer);
var dataTableAPI = exampleTable.DataTable({
"scrollCollapse": true,
"jQueryUI": true,
});
dataTableAPI.row.add(["1"]);
dataTableAPI.draw();