Hide table column generated in $this->table->generate() in CodeIgniter
<p>Been in codeigniter for a while now.</p>

<p>I am generating data from the database and organize the view data in a table using the <code>$this-&gt;table-&gt;generate(records);</code></p>

<p>It generates what is should be, but What if I want to HIDE the <code>id</code> that was selected in the query? Because whatever you selected in the <code>$this-&gt;db-&gt;select();</code> is also displayed in the table.</p>

<p>How to hide the <code>id</code> or prevent it from being showed in the table in the view?</p>

<p>Thanks in advance.</p>

<p><strong>My model is:</strong></p>

<pre><code>function clist($search) {
        $config["per_page"] = 10;
        $where = "fn LIKE '%%".$search."%%' OR mn LIKE '%%".$search."%%' OR ln LIKE '%%".$search."%%' OR suffix LIKE '%%".$search."%%' OR address_common LIKE '%%".$search."%%' OR address_brgy LIKE '%%".$search."%%' OR address_city_prov LIKE '%%".$search."%%' OR con_num LIKE '%%".$search."%%' OR date(date_created) LIKE '%%".$search."%%'";

        $this-&gt;db-&gt;select('id, CONCAT(fn," ",mn," ",ln," ",suffix) AS name,CONCAT(address_common,", ",address_brgy,", ",address_city_prov) AS address,con_num', FALSE);
        $this-&gt;db-&gt;select("DATE_FORMAT(date_created, '%M %d, %Y - %T') AS date_created", FALSE);

        if (!empty($search)) {
            $this-&gt;db-&gt;where($where);
        }
        $this-&gt;db-&gt;order_by('id', 'ASC');
        $rows = $this-&gt;db-&gt;get('tbl_cust_info', $config['per_page'], $this-&gt;uri-&gt;segment(3))-&gt;result_array();

        $index = $this-&gt;uri-&gt;segment(3) + 1;

        foreach ($rows as $count =&gt; $row) {
            array_unshift($rows[$count], $index.'.');
            $index = $index + 1;

            $rows[$count]['name'] = anchor(base_url().'raffle/clist_details/?i='.$row['id'],$row['name']);
        } return $rows;
    }
</code></pre>

<p><strong>My Controller is:</strong></p>

<pre><code>public function clist() {
        $data["title"] = "Customers' List";

        $this-&gt;load-&gt;library('table');

        $data["records"] = $this-&gt;raffle_model-&gt;clist($search);

        $data['thead'] = $this-&gt;table-&gt;set_heading('#','Name&lt;br /&gt;&lt;small&gt;(First Name Middle Name Last Name Suffix )&lt;/small&gt;','Address &lt;br /&gt;&lt;small&gt;(House #, Bldg. #, Compound, Street, Avenue etc., Barangay, City / Province)&lt;/small&gt;','Contact No&lt;br /&gt;&amp;nbsp','Date Created&lt;br /&gt;&amp;nbsp');
        $data['ttamplate'] =  $this-&gt;table-&gt;set_template(
            array(
                    'table_open' =&gt; 
                        '
                            &lt;div class="table-responsive"&gt;
                                &lt;table class="table table-hover table-bordered table-striped table-condensed"&gt;
                                    &lt;caption&gt;
                                        &lt;h3&gt;&lt;strong&gt;
                                            Customers
                                        &lt;/strong&gt;&lt;/h3&gt;
                                        &lt;small&gt;Below are the list of customers.&lt;/small&gt;
                                    &lt;/caption&gt;
                        '
                ));

        $data['pagelinks'] = $this-&gt;pagination-&gt;create_links();

        $this-&gt;load-&gt;view("templates/header", $data);
        $this-&gt;load-&gt;view("templates/nav", $data);
        $this-&gt;load-&gt;view("pages/cust_list", $data);
        $this-&gt;load-&gt;view("templates/footer", $data);
    }
</code></pre>

<p><strong>My view is:</strong></p>

<pre><code>&lt;div class="row"&gt;
    &lt;?php
        if(empty($records)){
        echo '&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="alert alert-danger" role="alert" style="text-align: center;"&gt;&lt;strong&gt;&lt; &lt; &lt; No Customer found. &gt; &gt; &gt;&lt;/strong&gt;&lt;/div&gt;';
      }else{
          $thead;
          $ttemplate;
          echo $this-&gt;table-&gt;generate($records);
        }
      ?&gt;
  &lt;/div&gt;
</code></pre>