Hidding datatable column and column data dynamically in Jquery
<p>I want to hide a column and its data in data table if some condition is true in J query. I am able to hide the column using below code whenever needed(condition is true). </p>

<pre><code>{
                            'targets': [1],
                            'render': function (data, type, row, meta){
                                var student= $("#studentName").val();
                                if(student==''){
                                    return '&lt;a href="URL?student='+row.student+'"&gt;'+row.student+'&lt;/a&gt;';
                                }else{
                                    table.columns([1]).visible(false);
                                }
                            }
                        },
</code></pre>

<p>But it throws below warning while loading data. If I click OK to warning, data is displayed as intended(column and its contents are not displayed) </p>

<blockquote>
  <p>"DataTables warning: table id={id} - Requested unknown parameter
  '{parameter}' for row {row-index}, column{column-index}"</p>
</blockquote>