title: JQuery datatables adding column classes to dynamic content
body: <p>I have a datatable that has dynamic columns</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;table id="dt_basic" width="100%" class="table table-striped table-bordered table-hover tableSearch"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              @foreach (var item in Model.ColumnInfo) {
              &lt;th&gt;@Html.Raw(@item.ColumnHeader) &lt;/th&gt;
              }
              &lt;th&gt;Edit&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;&lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I want to set the column type and column class after the datatable is populated</p>
  
  <pre><code>    var table = $('#dt_basic').dataTable({
          "pagingType": "full_numbers",
          "ajax": "@Url.Action("LoadResultGrid", "Verifications", new { id = Model.RunId })",
          "deferRender": true,
          "bProcessing": true,
          "scrollX": "100%",
          "columnDefs": [
              {
                  "targets": [0],
                  "visible": false,
                  "searchable": false
              },
              {
                  "targets": [1],
                  "searchable": true,
                  "visible": true
              }
          ]
      });
  </code></pre>
  
  <p>Model.ColumnInfo is a List of objects with attributes: ColumnHeader, ColumnType, ColumnClass.</p>
  
  <p>So I need to loop through the columns after the table has been created and match the column header to Model.ColumnInfo.ColumnHeader and then set the column type to the corresponding Model.ColumnInfo.ColumnType and the column class to the corresponding Model.ColumnInfo.CoulmnClass.</p>
  
  <p>Any help would be appreciated. Thanks.</p>