title: How do I hide a column in an asp:Table?
body: <p>I have a simple ASP.NET table like so:</p>
  
  <pre><code>&lt;asp:Table id="tbl"&gt;
      &lt;asp:TableHeaderRow id="header"&gt;
          &lt;asp:TableHeaderCell id="hcell1" /&gt;
      &lt;/asp:TableHeaderRow&gt;
      &lt;asp:TableRow id="row"&gt;
          &lt;asp:TableCell id="cell1" /&gt;
      &lt;/asp:TableRow&gt;
  &lt;/asp:Table&gt;
  </code></pre>
  
  <p>The ID's are made up and the actual table has several more columns. I want to be able to hide any column programmatically from the codebehind (not javascript). Is this possible? At this point I can easily change the markup to be pretty much whatever I want, so I'm open to suggestions.</p>
  
  <p>EDIT: Sorry to be clear. I want to be able to simply hide a column in such a way that if I add a new row I don't want to have to change any of the code that handles the hiding. The ideal would be something like:</p>
  
  <pre><code>tbl.Columns["ColName"].Visible = false;
  </code></pre>
  
  <p>Less ideal would be a for/foreach loop that did something similar.</p>