title: Creating table inside Datalist
body: <p>This is my DataList code , I define a table in headertemplate and close it in footerTemplate.</p>
  
  <p>The problem is with AlternatingItemStyle and ItemStyle that they don't effect.</p>
  
  <p>If i move the table defenition inside <code>&lt;ItemTemplate&gt;</code>   it does work.</p>
  
  <pre><code>&lt;asp:DataList ID="DataList1" runat="server" DataKeyField="ProductID" 
              DataSourceID="ObjectDataSource1" EnableViewState="False" 
              onitemdatabound="DataList1_ItemDataBound" Width="474px"&gt;
              &lt;AlternatingItemStyle CssClass="AlternatingRowStyle" /&gt;
              &lt;ItemStyle CssClass="RowStyle" /&gt;            
  
  
      &lt;HeaderTemplate&gt; 
        &lt;table  cellspacing="0" cellpadding="0"&gt;
      &lt;/HeaderTemplate&gt;
      &lt;ItemTemplate&gt;        
         &lt;div id="Comment"&gt;
  
              &lt;tr&gt;
                 &lt;div id="Data1"&gt;
                   &lt;td&gt;
                      &lt;asp:CheckBox ID="CheckBox1" runat="server" /&gt;
                   &lt;/td&gt;
                   &lt;td&gt;
                       &lt;asp:CheckBox ID="CheckBox2" runat="server" /&gt;
                   &lt;/td&gt;
                   &lt;td&gt;
                       &lt;asp:LinkButton ID="LinkButton1" runat="server" Text='&lt;%# Eval("CategoryName") %&gt;' /&gt;                                                          
                    &lt;/td&gt;
                 &lt;/div&gt;                                          
              &lt;/tr&gt;
              &lt;tr&gt;
                 &lt;td&gt;&lt;/td&gt;
                 &lt;td&gt;&lt;/td&gt;                                        
                 &lt;td&gt;
                    &lt;asp:Label ID="CategoryNameLabel" runat="server" Text="dfgfdgdg" /&gt;                     
                 &lt;/td&gt;                    
              &lt;/tr&gt;                                                                           
          &lt;/div&gt;        
      &lt;/ItemTemplate&gt;
  
     &lt;FooterTemplate&gt;  &lt;/table&gt;&lt;/FooterTemplate&gt;
  &lt;/asp:DataList&gt;
  </code></pre>