TableRow row = new TableRow(); TableCell cell1 = new TableCell(); cell1.Text = "Cell 1"; row.Cells.Add(cell1);
TableRow row = new TableRow(); TableCell cell1 = new TableCell(); cell1.Text = "First Cell"; row.Cells.Add(cell1); TableCell cell2 = new TableCell(); cell2.Text = "Second Cell"; row.Cells.Add(cell2);
TableRow row = new TableRow(); row.BackColor = System.Drawing.Color.Yellow; row.VerticalAlign = VerticalAlign.Top; row.TableSection = TableRowSection.TableBody;This code creates a table row and sets the background color to yellow, alignment to the top of the cell, and the table section to the body of the table. Package library: System.Web.UI.WebControls.