<%-- Tables2 Example --%>
<%@ Page Language=C# %>
<!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>
<script runat=server>
public void Page_Load(object sender, EventArgs e)
{
// Add rows to table.
table1.Rows.Add(new TableRow());
table1.Rows.Add(new TableRow());
// Add cells to row0.
table1.Rows[0].Cells.Add(new TableCell());
table1.Rows[0].Cells.Add(new TableCell());
table1.Rows[0].Cells.Add(new TableCell());
// Add cells to row1
table1.Rows[1].Cells.Add(new TableCell());
table1.Rows[1].Cells.Add(new TableCell());
table1.Rows[1].Cells.Add(new TableCell());
// Populate cells
table1.Rows[0].Cells[0].Text = Bulls;
table1.Rows[0].Cells[1].Text = Lakers;
table1.Rows[0].Cells[2].Text = Knicks;
table1.Rows[1].Cells[0].Text = Pistons;
table1.Rows[1].Cells[1].Text = Rockets;
table1.Rows[1].Cells[2].Text = Trailblazers;
}
</script>
<html xmlns=http://www.w3.org/1999/xhtml >
<head runat=server>
<title>Untitled Page</title>
</head>
<body>
<form id=form1 runat=server>
<div>
<asp:Table runat=server ID=table1>
</asp:Table>
</div>
</form>
</body>
</html>