title: datatable show/hide columns with checkbox
body: <p>I have a code in codeigniter, and i am using a data-table, now i want to make a show/hide columns with a checkbox above to let the columns hide or maybe shown. I will populate my data from my database in my controller with these code :</p>
  
  <pre><code>public function dataTable_report($date) {
          $user = array('user_id' =&gt; $this-&gt;session-&gt;userdata['logged_in']['user_id']);
          $myreport = $this-&gt;Adminreport_model-&gt;getreportDataDaily($user,$date);
  
          $data = array();
          foreach ($myreport as $patient) {
              $row = array();  
              $row[] = $patient-&gt;check_up_id;
              $row[] = $patient-&gt;patient_fname;
              $row[] = $patient-&gt;patient_lname;
              $row[] = $patient-&gt;patient_mname;
              $row[] = $patient-&gt;check_up_date;
              $row[] = $patient-&gt;clinic_name;
              $row[] = $patient-&gt;bill_amt;
  
              $data[] = $row;
          }
          $output = array(   
              "data" =&gt; $data,
          );
          echo json_encode($output);
      }
  </code></pre>
  
  <p>now here is my data-table that doesn't hide when i check my checkbox above please help me:
  <a href="https://jsfiddle.net/2j6w9hqt/27/" rel="nofollow noreferrer">https://jsfiddle.net/2j6w9hqt/27/</a></p>