jQuery DataTables: Column reordering and resizing - Allow resizing only
Example for article at https://www.gyrocode.com/articles/jquery-datatables-column-reordering-and-resizing/
by gyrocode
HTML
<link rel="stylesheet" href="https://cdn.datatables.net/v/dt/dt-1.10.16/datatables.min.css">
<script src="https://cdn.datatables.net/v/dt/dt-1.10.16/datatables.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jeffreydwalter/ColReorderWithResize@9ce30c640e394282c9e0df5787d54e5887bc8ecc/ColReorderWithResize.js"></script>
<h3><a target="_blank" href="https://www.gyrocode.com/articles/jquery-datatables-column-reordering-and-resizing/">jQuery DataTables: Column reordering and resizing</a> <small>Allow resizing only</small></h3>
<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Extn</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
JavaScript
$(document).ready(function (){
var table = $('#example').DataTable({
'ajax': 'https://gyrocode.github.io/files/jquery-datatables/arrays.json',
'dom': 'Rlfrtip',
'colReorder': {
'allowReorder': false
}
});
});