3
https://datatables.net/forums/discussion/72538/bug-responsive-searchpanes-layout-auto/p1?new=1
by Raidek
HTML
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.0.1/css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.11.5/css/dataTables.bootstrap5.min.css"/>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/searchpanes/2.0.0/css/searchPanes.bootstrap5.min.css"/>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/select/1.3.4/css/select.bootstrap5.min.css"/>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.0.1/js/bootstrap.bundle.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.11.5/js/dataTables.bootstrap5.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/searchpanes/2.0.0/js/dataTables.searchPanes.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/searchpanes/2.0.0/js/searchPanes.bootstrap5.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/select/1.3.4/js/dataTables.select.min.js"></script>
<table id="example" class="table table-striped table-bordered table-hover dt-responsive nowrap" style="width:100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tbody>
<tr>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
</tr>
<tr>
<td>Garrett...
JavaScript
$(document).ready(function() {
$('#example').DataTable({
searchPanes: {
layout: 'columns-6',
cascadePanes: true,
viewTotal: true,
//layout: 'auto'
},
dom: 'Plfrtip',
columnDefs: [{
searchPanes: {
show: true
},
targets: [0, 1, 2, 3, 4, 5]
}]
});
});
// EXAMPLE BOOTSTRAP https://datatables.net/extensions/searchpanes/examples/styling/bootstrap5.html
/*$(document).ready(function() {
var table = $('#example').DataTable({
searchPanes: {
cascadePanes: true,
viewTotal: true,
//layout: 'columns-6',
layout: 'auto'
},
dom: 'Plfrtip',
columnDefs: [{
searchPanes: {
show: true
},
targets: [0, 1, 2, 3, 4, 5]
}]
});
table.searchPanes.container().prependTo(table.table().container());
table.searchPanes.resizePanes();
});*/