using System.Web.UI.HtmlControls;
HtmlGenericControl div1 = new HtmlGenericControl("div");
div1.ID = "div1";
// add whatever attributes you need, eg make it scrollable:
div1.Attributes["style"] = "overflow: auto; width: 400px; height: 150px;";
// initialize your table
HtmlTable table1 = new HtmlTable();
table1.ID = "table1";
//....
// add the table to the div:
div1.Controls.Add(table1);
// add it to some PlaceHolder:
placeHolder1.Controls.Add(div1);
Greetings
Martin
"DJ Dev" <ri*********@icn.siemens.com> wrote in message
news:11*************************@posting.google.co m...
Hi All,
I would like to add the <div> tag programatically from the code-behind
of my aspx file. Basically, I would like to a table to this <div>.
There are a number of tables which are created dynamically in the
code-behind. Each table should go to its own <div> tag.
The reason that I can't have the <div> tags in aspx is that the number
of the tables is unknown until runtime and each table should go into
its own <div> tag.
How is this possible?
Thanks.