JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.4.1/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.19/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<table class="table response-table table-fixed" id="fixed-table">
<thead>
<tr>
<th scope="col">th1</th>
<th scope="col">th2</th>
<th scope="col">th3</th>
<th scope="col">th4</th>
<th scope="col">th5</th>
<th scope="col">th6</th>
<th scope="col">th7</th>
<th scope="col">th8</th>
<th scope="col">th9</th>
<th scope="col">th10</th>
<th scope="col">th11</th>
<th scope="col">th12</th>
<th scope="col">th13</th>
</tr>
</thead>
<tbody>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
<td>8</td>
<td>9</td>
<td>10</td>
<td>11</td>
<td>Perfect. Universities have been postponing classes here because of nationwide protests so I've been using this course to catch up on Java I'm supposed to be taking, and it has been a seamless experience so far. Teacher is clear and concise and has a nice way of explaining things. Didn't expect this high of a quality from a free course. Thank you!</td>
<td>13</td>
...
JavaScript
$(document).ready(function(){
$('#fixed-table').DataTable({
data: this.responseDetails,
searching: false,
ordering: false,
lengthChange: false,
'createdRow': function (row, data, rowIndex) {
// Per-cell function to do whatever needed with cells
$.each($('td', row), function (colIndex) {
// For example, adding data-* attributes to the cell
$(this).attr('title', $(this).text());
});
},
columnDefs: [ {
targets: 10,
render: function ( data, type, row ) {
return type === 'display' && data.length > 10 ?
data.substr( 0, 15) + '…' :
data;
}
},{
targets: 11,
render: function ( data, type, row ) {
return type === 'display' && data.length > 10 ?
data.substr( 0, 15) + '…' :
data;
}
},
{
targets: 12,
render: function ( data, type, row ) {
return type === 'display' && data.length > 10 ?
data.substr( 0, 15) + '…' :
data;
}
} ]
});
});