var table;
$(document).ready(function() {
table = $('#example').DataTable( {
data: dataSet,
columns: [
{ title: "Name" },
{ title: "Position" },
{ title: "Office" },
{ title: "Extn." },
{ title: "Start date" },
{ title: "Salary" }
],
"searching": false,
"lengthChange": false,
"responsive":true
});
});
function recalc() {
table.responsive.recalc();
}
function openNavLeft() {
document.getElementById("mySidebarLeft").style.width = "250px";
document.getElementById("main").style.marginLeft = "250px";
recalc();
}
function openNavRight() {
document.getElementById("mySidebarRight").style.width = "250px";
document.getElementById("main").style.marginRight = "250px";
recalc();
}
function closeNavLeft() {
document.getElementById("mySidebarLeft").style.width = "0";
document.getElementById("main").style.marginLeft= "0";
recalc();
}
function closeNavRight() {
document.getElementById("mySidebarRight").style.width = "0";
document.getElementById("main").style.marginRight= "0";
recalc();
}
var dataSet = [
[ "Tiger Nixon", "System Architect", "Edinburgh", "5421", "2011/04/25", "$320,800" ],
[ "Garrett Winters", "Accountant", "Tokyo", "8422", "2011/07/25", "$170,750" ],
[ "Ashton Cox", "Junior Technical Author", "San Francisco", "1562", "2009/01/12", "$86,000" ],
[ "Cedric Kelly", "Senior Javascript Developer", "Edinburgh", "6224", "2012/03/29", "$433,060" ],
[ "Airi Satou", "Accountant", "Tokyo", "5407", "2008/11/28", "$162,700" ],
[ "Brielle Williamson", "Integration Specialist", "New York", "4804", "2012/12/02", "$372,000" ],
[ "Herrod Chandler", "Sales Assistant", "San Francisco", "9608", "2012/08/06", "$137,500" ],
[ "Rhona Davidson", "Integration Specialist", "Tokyo", "6200", "2010/10/14", "$327,900" ],
[ "Colleen Hurst", "Javascript Developer", "San Francisco", "2360", "2009/09/15", "$205,500" ],
];
.sidebarLeft {
height: 100%;
width: 0;
position: fixed;
z-index: 1;
top: 0;
left: 0;
background-color: #111;
overflow-x: hidden;
transition: 0.5s;
padding-top: 60px;
}
.sidebarRight {
height: 100%;
width: 0;
position: fixed;
z-index: 1;
top: 0;
right: 0;
background-color: #111;
overflow-x: hidden;
transition: 0.5s;
padding-top: 60px;
}
.sidebarRight .closebtnRight {
position: absolute;
top: 0;
left: 25px;
font-size: 36px;
margin-right: 50px;
}
.sidebarLeft .closebtnLeft {
position: absolute;
...
</script>