HTML表

时间:2016-08-10 05:35:03

标签: c# html asp.net

这里我想显示来自html生成器的分页系统...我该如何做到这一点任何分页样式都是可以接受的...(1..2..3..4 ..)或者 (Next<previous>

需要使用jquery或任何东西在HTML表格中轻松轻松地进行分页。我用html表来填表。现在我需要添加分页。提前致谢。我的HTML表的结构

public string LoadDealHistory(DealHistory aDealhistory)
{
    StringBuilder html = new StringBuilder();
    try
    {
       using (DealTranctionGateway dealTranctionGateway = new DealTranctionGateway())
        {
            DataTable dt = new DataTable();
            dt = dealTranctionGateway.LoadDealHistory(aDealhistory);
            string dealHistory = "";
            string updateOn = "";
            if (dt.Rows.Count > 0)
            {

                html.Append("<table class='table table-bordered'>");
                html.Append("<thead>");
                html.Append("<tr>");
                html.Append("<th>S.No</th>");
                html.Append("<th>FieldType</th>");
                html.Append("<th>OldValue</th>");
                html.Append("<th>NewValue</th>");
                html.Append("<th>Admin Name</th>");
                html.Append("<th>Merchant Name</th>");
                html.Append("<th>UpdateOn</th>");
                html.Append("</thead>");
                html.Append("</tr>");

                for (int i = 0; i < dt.Rows.Count; i = i + 1)
                {
                    int sNo = i + 1;
                    html.Append("<tr>");
                    html.Append("<td>" + sNo + "</td>");
                    html.Append("<td>" + dt.Rows[i]["field"] + "</td>");
                    html.Append("<td>" + dt.Rows[i]["old"] + "</td>");
                    html.Append("<td>" + dt.Rows[i]["new"] + "</td>");

                    if (string.IsNullOrEmpty(dt.Rows[i]["Name"].ToString()) == true && dt.Rows[i]["MerchantName"] != null)
                    {
                        html.Append("<td></td>");
                        html.Append("<td>" + dt.Rows[i]["MerchantName"] + "</td>");
                    }

                    else if (dt.Rows[i]["Name"] != null && dt.Rows[i]["MerchantName"] != null)
                    {
                        html.Append("<td>" + dt.Rows[i]["Name"] + "</td>");
                        html.Append("<td></td>");
                    }

                    updateOn = ((DateTime)dt.Rows[i]["UpdatedOn"]).ToString("dd-MM-yyyy", CultureInfo.InvariantCulture);
                    html.Append("<td>" + updateOn + "</td>");
                    // html.Append("<td>" + dt.Rows[i]["UpdatedOn"].ToString("dd-MM-yyyy", CultureInfo.InvariantCulture) + "</td>");
                    html.Append("</tr>");
                }
                html.Append("</tbody>");
                html.Append("</table>");
            }
        }
    }
    catch (Exception ex)
    {
    }
    return html.ToString();
}

0 个答案:

没有答案