Hi,
Please refer below code.
HTML
<div>
<fieldset>
<legend>GPNL MIS Details :</legend>
<table id="table01">
<tr>
<th>
S.N.
</th>
<th>
Scheme Name & Code
</th>
<th>
Deposit Amount
</th>
<th>
Monthly Income
</th>
<th>
Maturity Amount
</th>
<th>
Action
</th>
</tr>
<%=getData() %>
</table>
</fieldset>
</div>
C#
public string getData()
{
string htmlstr = string.Empty;
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[] {
new DataColumn("sn"),
new DataColumn("MIS_Code"),
new DataColumn("DepositAmount"),
new DataColumn("MonthlyIncome"),
new DataColumn("MaturityAmount")
});
dt.Rows.Add(1, "1254d", 5000, 100, 100000);
dt.Rows.Add(2, "1454d", 6000, 120, 150000);
foreach (DataRow rdr in dt.Rows)
{
int sn = Convert.ToInt32(rdr[0]);
string code = rdr[1].ToString();
string deposit = rdr[2].ToString();
string income = rdr[3].ToString();
string maturity = rdr[4].ToString();
string action = string.Format("<a href='edit_page.aspx?MIS_Code={0}'><img src='Images/Edit.gif' alt='Edit' /> </a>", code);
htmlstr += "<tr><td>" + sn + "</td><td>" + code + "</td><td>" + deposit + "</td><td>" + income + "</td><td>" + maturity + "</td><td>" + action + "</td></tr>";
}
return htmlstr;
}
Screenshot