title: How do I update DataTables columns (and other properties) dynamically?
body: <p>There are a few questions here on SO about updating the columns in DataTables dynamically, but they all seem very out of date as they reference deprecated properties like <code>aoColumns</code>.</p>
  
  <p>My code looks something like this:</p>
  
  <pre><code>var oTableOptions = {
      columns: [
          {title: "Column 1", data: "col1"},
          {title: "Column 2", data: "col2"},
          {title: "Column 3", data: "col3"}
      ],
      order: [
          [0, 'desc'],
          [1, 'asc']
      ],
      paging: false,
      searching: false,
      info: false
  }
  
  var dt = $('#tableId').DataTable(oTableOptions);
  </code></pre>
  
  <p>Couple of questions:</p>
  
  <ol>
  <li><strong>How do I update the default sorting order?</strong> If I want to dynamically change it to something like  <code>[[0, 'asc'], [1, 'asc']]</code> instead (the next time the table is redrawn), how do I do this?</li>
  </ol>
  
  <p>The following code <em>doesn't</em> work, so what am I missing?</p>
  
  <pre><code>dt.order = [[0, 'asc'], [1, 'asc']];
  dt.ajax.reload();
  </code></pre>
  
  <ol start="2">
  <li><p><strong>How do I rename an existing column?</strong> I couldn't find any documented method for doing this. Is there one, or do I just have to use jQuery directly?</p></li>
  <li><p><strong>How do I add/remove columns?</strong></p></li>
  </ol>