jQuery DataTables Checkboxes: Data Sources - JavaScript (arrays/objects)

For more information, see https://www.gyrocode.com/projects/jquery-datatables-checkboxes/

by gyrocode

HTML

<link rel="stylesheet" href="https://cdn.datatables.net/s/dt/dt-1.10.10,se-1.1.0/datatables.min.css">
<script src="https://cdn.datatables.net/s/dt/dt-1.10.10,se-1.1.0/datatables.min.js"></script>
<script src="https://gyrocode.github.io/jquery-datatables-checkboxes/1.2.11/js/dataTables.checkboxes.min.js"></script>
<link rel="stylesheet" href="https://gyrocode.github.io/jquery-datatables-checkboxes/1.2.11/css/dataTables.checkboxes.css">
<h3><a href="https://www.gyrocode.com/projects/jquery-datatables-checkboxes/">jQuery DataTables Checkboxes</a>: <a target="_blank" href="https://www.gyrocode.com/projects/jquery-datatables-checkboxes/examples/data-sources/">Data Sources</a> - <a target="_blank" href="https://www.gyrocode.com/projects/jquery-datatables-checkboxes/examples/data-sources/js/">JavaScript (arrays/objects)</a> -  - Array of arrays</h3>
    
<table id="example" class="display" cellspacing="0" width="100%">
   <thead>
      <tr>
         <th></th>
         <th>Name</th>
         <th>Position</th>
         <th>Office</th>
         <th>Extn</th>
         <th>Start date</th>
         <th>Salary</th>
      </tr>
   </thead>
   <tfoot>
      <tr>
         <th></th>
         <th>Name</th>
         <th>Position</th>
         <th>Office</th>
         <th>Age</th>
         <th>Start date</th>
         <th>Salary</th>
      </tr>
   </tfoot>
</table>

<hr><a target="_blank" href="https://www.gyrocode.com/projects/jquery-datatables-checkboxes/examples/basic/basic-initialization/">See full article on Gyrocode.com</a>

JavaScript

$(document).ready(function() {

   var data = [
      [
         "1",
         "Tiger Nixon",
         "System Architect",
         "Edinburgh",
         "5421",
         "2011\/04\/25",
         "$320,800"
      ],
      [
         "2",
         "Garrett Winters",
         "Accountant",
         "Tokyo",
         "8422",
         "2011\/07\/25",
         "$170,750"
      ],
      [
         "3",
         "Ashton Cox",
         "Junior Technical Author",
         "San Francisco",
         "1562",
         "2009\/01\/12",
         "$86,000"
      ],
      [
         "4",
         "Cedric Kelly",
         "Senior Javascript Developer",
         "Edinburgh",
         "6224",
         "2012\/03\/29",
         "$433,060"
      ],
      [
         "5",
         "Airi Satou",
         "Accountant",
         "Tokyo",
         "5407",
         "2008\/11\/28",
         "$162,700"
      ],
      [
         "6",
         "Brielle Williamson",
         "Integration Specialist",
         "New York",
         "4804",
         "2012\/12\/02",
         "$372,000"
      ],
      [
         "7",
         "Herrod Chandler",
         "Sales Assistant",
         "San Francisco",
         "9608",
         "2012\/08\/06",
         "$137,500"
      ],
      [
         "8",
         "Rhona Davidson",
         "Integration Specialist",
         "Tokyo",
         "6200",
         "2010\/10\/14",
         "$327,900"
      ],
      [
         "9",
         "Colleen Hurst",
         "Javascript Developer",
         "San Francisco",
         "2360",
         "2009\/09\/15",
         "$205,500"
      ],
      [                 
         "10",
         "Sonya Frost",
         "Software Engineer",
         "Edinburgh",
         "1667",
         "2008\/12\/13",
         "$103,600"
      ],
      [
         "11",
         "Jena Gaines",
         "Office Manager",
         "London",
         "3814",
         "2008\/12\/19",
         "$90,560"
      ],
      [
         "12",
         "Quinn Flynn",
  ...