JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Test</title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.18/css/jquery.dataTables.css"/>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/scroller/1.5.0/css/scroller.dataTables.css"/>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/select/1.2.6/css/select.dataTables.css"/>
</head>
<body>
<table id="rulesTable" class="table table-bordered table-striped" width="100%"></table>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.18/js/jquery.dataTables.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/scroller/1.5.0/js/dataTables.scroller.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/select/1.2.6/js/dataTables.select.js"></script>
<script>
$(document).ready(function () {
// allow sorting of checkbox columns
$.fn.dataTable.ext.order['dom-checkbox'] = function (settings, col) {
return this.api().column(col, {order: 'index'}).nodes().map(function (td, i) {
return $(td).closest('tr').hasClass('selected') ? '0' : '1';
});
};
var data = [];
for (var i = 0; i < 1000; i++) {
data.push({"col1": i, "col2": i, "col3": i});
}
showRules(data);
});
function showRules(data) {
var columns = [
{defaultContent: ""},
{data: 'col1', title: 'Column 1'},
{data: 'col2', title: 'Column 2'},
{data:...