title: How can I display records in multiple tables dynamically using repeater or datalist control in ASP.NET?
body: <p>What I would like to do is show the records I get in datatable in different HTML tables. The records in the datatable have 3 columns and I can have a max of 6 records. </p>
  
  <p>The datatable I am getting from the database is as follows:</p>
  
  <pre><code>Name   Age
  -----------  
  XYZ    30
  
  XY1    31
  
  XY2    32
  
  XY3    33 
  </code></pre>
  
  <p>And I want to show the records in the following way:</p>
  
  <pre><code>Name   Age   Name   Age
  -----------------------
  XYZ    30    XY1    31
  
  Name   Age   Name   Age
  -----------------------     
  XY2    32    XY3    33
  
  
  Total Strength of employees : 4
  </code></pre>
  
  <p>What I am currently doing is as follows (although this is not what I want, but have tried):</p>
  
  <pre><code>&lt;asp:Repeater ID="RptNCode" runat="server" OnItemCommand="RptNcode_ItemCommand" 
    OnItemDataBound="RptNCode_ItemDataBound" &gt;
      &lt;HeaderTemplate&gt;
      &lt;tr style="background-color: #507CD1; color: 
      White; font-weight: bold; text-align: center; height: 20px"&gt;
              &lt;td style="color: White;"&gt;
                  Sr.No
              &lt;/td&gt;
              &lt;td style="color: White; text-align: left"&gt;
                  Name
              &lt;/td&gt;
              &lt;td style="color: White; text-align: right"&gt;
                   Age 
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/HeaderTemplate&gt;
      &lt;ItemTemplate&gt;
     &lt;tr style="background-color: #ffffff; height: 20px; font-family: Arial"&gt;
  
              &lt;td align="left" style="font-size: 15;"&gt;
                  &lt;asp:LinkButton ID="lnkNCode" ForeColor="#336699" runat="server" Text='&lt;%# Eval("Name") %&gt;'
                      CommandArgument='&lt;%# Eval("Name") %&gt;' CommandName="NCode"&gt;&lt;/asp:LinkButton&gt;
              &lt;/td&gt;
              &lt;td align="center" style="font-size: 15; text-align: right;"&gt;
                  &lt;%#  Eval("Age")%&gt;
  
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/ItemTemplate&gt;
      &lt;AlternatingItemTemplate&gt;
          &lt;tr style="background-color: #ffffff; height: 20px; font-family: Arial"&gt;
  
              &lt;td align="left" style="font-size: 15;"&gt;
                  &lt;asp:LinkButton ID="lnkNCode" ForeColor="#336699" runat="server" Text='&lt;%# Eval("Name") %&gt;'
                      CommandArgument='&lt;%# Eval("Name") %&gt;' CommandName="NCode"&gt;&lt;/asp:LinkButton&gt;
              &lt;/td&gt;
              &lt;td align="center" style="font-size: 15; text-align: right;"&gt;
                  &lt;%#  Eval("Age")%&gt;
  
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/AlternatingItemTemplate&gt;
      &lt;FooterTemplate&gt;
          &lt;tr&gt;
  
              &lt;td align="right" height="40px"&gt;
                  &lt;asp:Label ID="lblTotal" runat="server" Font-Bold="true" ForeColor="#336699"&gt;&lt;/asp:Label&gt;
  
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/FooterTemplate&gt;
  &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p>I know this is not correct but it is what I have done so far. Is what I am trying to do possible or not? </p>
  
  <p>Thanks.</p>