title: Table paging in asp.net html table
body: <p>Hi guys is there a way where I can have a paging in my table?</p>
  
  <p>My table is coded like this in html.</p>
  
  <pre><code>&lt;table width="100%"  id="tbl_Delivered"&gt;
  &lt;tr&gt;
      &lt;td width="30%"&gt;
      &lt;/td&gt;
      &lt;td width="45%" class="GRIDVIEW_TITLE"&gt;
              &lt;asp:Label ID="Label5" runat="server" Text="DELIVERED"&gt;&lt;/asp:Label&gt;
          &lt;/td&gt;
          &lt;td&gt;
  
          &lt;/td&gt;
  &lt;/tr&gt;
      &lt;tr &gt;
          &lt;td width="30%"&gt;
              &amp;nbsp;&lt;/td&gt;
          &lt;td width="45%"&gt;
              &lt;div id="Delivered" runat="server"&gt;
  
              &lt;/div&gt;
          &lt;/td&gt;
          &lt;td width="45%"&gt;
              &amp;nbsp;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Then I have a stored procedure that will place another series of td's in </p>
  
  <pre><code>&lt;div id="Delivered" runat="server"&gt;
  
                  &lt;/div&gt;
  </code></pre>
  
  <p>Part of my stored procedure is this</p>
  
  <pre><code> DECLARE @DELIVERED VARCHAR(MAX)
          SELECT @DELIVERED = ''
          SELECT ALL 
          @DELIVERED =   @DELIVERED + '&lt;TR class="GRIDVIEW_DETAILS"&gt;' +
                                          '&lt;TD WIDTH ="100" ALIGN="LEFT"&gt;&lt;A HREF="/D2MS/wTransmittalSearch.aspx?ref='+RefNumber+'"&gt;'+RefNumber+'&lt;/A&gt;&lt;/TD&gt;' +
                                          '&lt;TD WIDTH ="100" ALIGN="LEFT"&gt;' +  airwaybillno  + '&lt;/TD&gt;' +
                                          '&lt;TD WIDTH ="250" ALIGN="LEFT"&gt;' +  RTRIM(UPPER(deliverto))  + '&lt;/TD&gt;' +        
                                      '&lt;/TR&gt;' 
          FROM #temp_delivered
          --ORDER BY deliverdate DESC
          SET @DELIVERED = 
          '&lt;TABLE WIDTH="100%"&gt;' +
          '&lt;TR  class="GRIDVIEW" &gt;&lt;TD &gt;REFERENCE #&lt;/TD&gt;&lt;TD&gt;AIRWAYBILL #&lt;/TD&gt;&lt;TD ALIGN="LEFT"&gt;DELIVER TO&lt;/TD&gt;&lt;/TR&gt;' +
          + @DELIVERED + 
          '&lt;/TABLE&gt;'
  
      select @DELIVERED AS HTML from #temp_delivered
  </code></pre>
  
  <p>Then I have a c# code to append my html code from stored procedure to the webpage</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
      {
          if (!IsPostBack)
          {
              dsView = dm.ViewDelivered(Session["Username"].ToString());
              //gridsummary.DataSource = dsView.Tables[0];
              //gridsummary.DataBind();
  
              #region old
              string sDelivered = string.Empty;
              DataTable dt = new DataTable();
              dt = dsView.Tables[0];
              List&lt;string&gt; slistPostal = new List&lt;string&gt;();
              foreach (DataRow dr in dt.Rows)
              {
                  if (dr[0].ToString() == "DELIVERED")
                  {
                      sDelivered = dr["HTML"].ToString();
                      Delivered.InnerHtml = sDelivered;
                  }
  
              }
              #endregion
  
          }
      }
  </code></pre>
  
  <p>I am loading many data so I want to have a paging in my table, is there any way to do that? Thanks in advance.</p>
  
  <p>For Tomer Klein this is the error</p>
  
  <p><img src="https://i.stack.imgur.com/bRrJv.png" alt="enter image description here"></p>