public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Table table = new Table();
//设置表格样式
table.BorderStyle = BorderStyle.Dotted;
table.CellPadding = 3;
table.CellSpacing = 3;
table.BorderColor = System.Drawing.Color.Blue;
for (int i = 1; i < 4; i++)
{
TableRow row = new TableRow();
for (int j = 1; j < 4; j++)
{
TableCell cell = new TableCell();
cell.Text = "xgh00" + j.ToString();
row.Cells.Add(cell);
}
table.Rows.Add(row);
}
this.Controls.Add(table);
}
}