title: HTMLtableCell is not working for table header (th) in asp.net
body: <p>I have repeater control that have table with table header(th) and table cell(td). I want to access td and th in code. I use HTMLTableCell for both in repeater code, I can access the td, but th is not working. Any suggestions
  Here is the code sample:</p>
  
  <pre><code>&lt;asp:Repeater ID="rpt" runat="server" OnItemDataBound="repeater_ItemDataBound" &gt;
  &lt;HeaderTemplate&gt;
      &lt;table id="tbl" &gt;
      &lt;thead&gt;
      &lt;tr&gt;
        &lt;th id="header1" runat="server"&gt;head 1/th&gt;
        &lt;th"&gt;Head 2&lt;/th&gt;
   &lt;/tr&gt;
      &lt;/thead&gt;  
  &lt;/HeaderTemplate&gt;
  &lt;ItemTemplate&gt;
      &lt;tr&gt;
        &lt;td id="td1" runat="server" &gt;&lt;asp:Literal ID="litTD1" runat="server" /&gt;&lt;/td&gt;
        &lt;td  &gt;&lt;asp:Literal ID="litTD2" runat="server" /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/ItemTemplate&gt;
  &lt;FooterTemplate&gt;
      &lt;/table&gt;
  &lt;/FooterTemplate&gt;
  &lt;/asp:Repeater&gt;
  
  in code behind
  
  HtmlTableCell header1= e.Item.FindControl("header1") as HtmlTableCell;
  HtmlTableCell td1= e.Item.FindControl("td1") as HtmlTableCell;
  </code></pre>
  
  <p>This code works for td1 (which is cell) but object null reference exception on header1
  Sorry, I do have runat="server" for th</p>