Position of a dynamic table

Discussion in 'ASP .Net Web Controls' started by KSO, Oct 19, 2007.

  1. KSO

    KSO Guest

    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.
     
    KSO, Oct 19, 2007
    #1
    1. Advertisements

  2. KSO

    Mansi Shah Guest

    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.

    *** Sent via Developersdex http://www.developersdex.com ***
     
    Mansi Shah, Oct 19, 2007
    #2
    1. Advertisements

  3. KSO

    KSO Guest

    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

    "Mansi Shah" wrote:

    >
    > 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.
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    >
     
    KSO, Oct 21, 2007
    #3
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Williams
    Replies:
    2
    Views:
    1,354
    Jacob Yang [MSFT]
    Aug 12, 2003
  2. =?Utf-8?B?QkxpVFpXaU5H?=

    Adding dynamic LinkButton to dynamic table

    =?Utf-8?B?QkxpVFpXaU5H?=, Jul 27, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    869
    =?Utf-8?B?QkxpVFpXaU5H?=
    Jul 27, 2005
  3. Luqman
    Replies:
    1
    Views:
    804
    Luqman
    Feb 7, 2006
  4. Rio
    Replies:
    4
    Views:
    1,446
  5. Replies:
    1
    Views:
    475
    Lloyd Sheen
    Mar 24, 2008
  6. opius
    Replies:
    0
    Views:
    1,315
    opius
    Jun 17, 2011
  7. Kooki

    Dynamic Table with Dynamic Button inside

    Kooki, Sep 15, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    244
    Kooki
    Sep 15, 2005
  8. Ted Byers
    Replies:
    9
    Views:
    348
    Ted Byers
    Dec 4, 2008
Loading...