JSFiddle - React, Tailwind, and code Playground
by Marco Colombo
HTML
<script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css">
<body>
<div>
<h2>#1: Long DataTable defined runtime using columnDefs</h2>
<table id="table01">
</table>
</div>
<div style="margin-top: 100px;">
<h2>#2: Short DataTable defined runtime using columnDefs</h2>
<table id="table02">
</table>
</div>
</body>
JavaScript
$(document).ready(function() {
var longDataSet = [{
name: 'Mario',
surname: 'Rossi',
age: 13,
country: 'Italy',
address: 'via Parini, 20',
city: 'Milano',
longText1: 'asdasnfsnfasnfansdjasndjnafan',
longText2: 's9489sd84fs1d4gsd94g89sf4gs49',
longText3: '7he23uru23gh8t3hf9h239th9h92j',
longText4: '353463rfsdsdffvsw5d4ffsecdwwd'
}, {
name: 'Marco',
surname: 'Bianchi',
age: 20,
country: 'Italy',
address: 'via Garibaldi, 1',
city: 'Novara',
longText1: 'asdasnfsnfasnfansdjasndjnafan',
longText2: 's9489sd84fs1d4gsd94g89sf4gs49',
longText3: '7he23uru23gh8t3hf9h239th9h92j',
longText4: '353463rfsdsdffvsw5d4ffsecdwwd'
}, {
name: 'Matteo',
surname: 'De Gasperi',
age: 70,
country: 'Italy',
address: "via dell'Alpino, 12",
city: 'Como',
longText1: 'asdasnfsnfasnfansdjasndjnafan',
longText2: 's9489sd84fs1d4gsd94g89sf4gs49',
longText3: '7he23uru23gh8t3hf9h239th9h92j',
longText4: '353463rfsdsdffvsw5d4ffsecdwwd'
}, {
name: 'Mario',
surname: 'Rossi',
age: 13,
country: 'Italy',
address: 'via Parini, 20',
city: 'Milano',
longText1: 'asdasnfsnfasnfansdjasndjnafan',
longText2: 's9489sd84fs1d4gsd94g89sf4gs49',
longText3: '7he23uru23gh8t3hf9h239th9h92j',
longText4: '353463rfsdsdffvsw5d4ffsecdwwd'
}, {
name: 'Marco',
surname: 'Bianchi',
age: 20,
country: 'Italy',
address: 'via Garibaldi, 1',
city: 'Novara',
longText1: 'asdasnfsnfasnfansdjasndjnafan',
longText2: 's9489sd84fs1d4gsd94g89sf4gs49',
longText3: '7he23uru23gh8t3hf9h239th9h92j',
longText4: '353463rfsdsdffvsw5d4ffsecdwwd'
}, {
name: 'Matteo',
surname: 'De Gasperi',
age: 70,
country: 'Italy',
address: "via dell'Alpino, 12",
city: 'Como',
longText1: 'asdasnfsnfasnfansdjasndjnafan',
longText2: 's9489sd84fs1d4gsd94g89sf4gs49',
longText3: '7he23uru23gh8t3hf9h239th9h92j',
longText4:...