This sample will help to add rows and cells into a asp.net table using C#.
You need to first create a row and then create a cell assign the properties of cell and then add the cell to row and then row to table.
How Dynamically Add Rows into ASP.NET Table using C# Example:
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
TableRow tr = new TableRow();
TableCell tc = new TableCell();
tc.Text = "PetsMantra.com";
tr.Cells.Add(tc);
TableCell tc2 = new TableCell();
tc2.Text = "Join2Green.com";
tr.Cells.Add(tc2);
tblSample.Rows.Add(tr);
}
</script>
<html>
<head>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:table ID="tblSample" runat="server"></asp:table>
</div>
</form>
</body>
</html>