Position of a dynamic table

K

KSO

By C#-code I want to place a table UNDER my last WEB control - witch I placed
with the designer.

My problem is that the table is inserted in the topleft of the IE window -
on top of my other WEB controls.

I think the controls must have a position-property but I can't find it.
 
M

Mansi Shah

Hi,

It should display dynamic table at the end of all controls.

And you might have created "Table" dynamically not "HtmlTable", that's
why it is not displaying Align Property.
If you use HtmlTable instead Table then you have Align Property which
you can declare to "Center". Like:

public void createTable()
{
HtmlTable t = new HtmlTable();
for (int j = 1; j < 3; j++)
{
HtmlTableRow row = new HtmlTableRow();
// Iterate through the cells of a row.
for (int i = 0; i < 4; i++)
{
// Create a new cell and add it to the Cells
collection.
HtmlTableCell cell = new HtmlTableCell();
cell.Controls.Add(new LiteralControl("row " +
j.ToString() + ", cell " + i.ToString()));
row.Cells.Add(cell);
}
t.Rows.Add(row);
t.Align = "Center";
}
this.Controls.Add(t);
}

You can call this function from anywhere in your code.

Regards,
Mansi Shah.
 
K

KSO

Thanks Mansi Shan for your time BUT ...

I want to use "Table" - not "HtmlTable" - and it will work if I place a
"Table" in the right position by "Design view" and then by code adds rows and
cells.

When I can place it this way by "Design view" then "Table" must have a
position-propterty somewhere, I think - that's the one I'm looking for.

How can I find it ?

Best regards
KSor, Denmark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top