GreenRock Software Code Comment

February 19, 2008

PopulateHTMLTable()

Filed under: Populate HTMLTable — greenrocksoftware @ 2:22 pm

public void PopulateHTMLTable()

{

    int numrows = 5;

    int numcells = 7;

    for (int j = 0; j < numrows – 1; j++)

    {

        HtmlTableRow r = new HtmlTableRow();

        for (int i = 0; i < numcells – 1; i++)

        {

            HtmlTableCell c = new HtmlTableCell();

            c.InnerHtml = “Created from” + Environment.NewLine + “code behind”;

            //c.Controls.Add(new LiteralControl(”row ” + j.ToString() + “, cell ” + i.ToString()));

            r.Cells.Add(c);

        }

        this.Table1.Rows.Add(r);

    }

}

Blog at WordPress.com.