ASP.NET AddTable
protected void BtnSace_Click( object sender, EventArgs e )
{
int cellCount = int.Parse( this.TextBox1.Text );
int rowCount = int.Parse( this.TextBox2.Text );
string data = this.TextBox3.Text;
for ( int i = 0; i < rowCount; i++ )
{
TableRow row = new TableRow( );
Table1.Rows.Add( row );
string input = this.TextBox1.Text;
for ( int j = 0; j < cellCount; j++ )
{
TableCell cell = new TableCell( );// + j + input + i new LiteralControl( +i)
cell.Controls.Add(new LiteralControl(input));
row.Cells.Add( cell );
cell.Width = Unit.Pixel( 40 );
cell.Text = data;
}
}
}