Newbie Question About Setting Table Column Width

Discussion in 'ASP .Net' started by =?Utf-8?B?Um9iZXJ0IFcu?=, Mar 31, 2006.

  1. I'm new to web programming so please excuse my ignorance. With that said ...

    I've added a 2-column, 3 row table to control the placement of everything on
    the web page. The first row contains the header and spans the entire width.
    The last row contains the footer and also spans the entire width.

    I'm constructing a web page that has a header and footer across the entire
    width of the page. Sandwiched in between these is the center row, which
    contains a menu on the left and then the body of the page on the right.

    I explicitly set the width of the left menu to 100 pixels and I didn't set
    any width to the right column. I assumed that this would give the menu a
    fixed width and only the width of the right column would change. But this
    didn't happen. So what do I need to do?

    I'm also wondering about something else: Can I programmatically change the
    dimensions of the table? If so, how do I reference the various parts of the
    table? I did add IDs to them but don't know how to reference them.


    --
    Robert W.
    Vancouver, BC
    www.mwtech.com
     
    =?Utf-8?B?Um9iZXJ0IFcu?=, Mar 31, 2006
    #1
    1. Advertising

  2. Robert,

    You have to give your table a width. That width could be fixed, say 800
    pixels or it could be a percent, say 90% you can play with that.

    Here's the overall structure:

    <table width="800">
    <tr>
    <td colspan="2">
    Header
    </td>
    </tr>
    <tr>
    <td width="100px">
    Menu
    </td>
    <td>
    Body
    </td>
    </tr>
    <tr>
    <td colspan="2">
    Footer
    </td>
    </tr>
    </table>

    Regards,

    --
    S. Justin Gengo
    Web Developer / Programmer

    Free code library:
    http://www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzsche


    "Robert W." <> wrote in message
    news:D...
    > I'm new to web programming so please excuse my ignorance. With that said
    > ...
    >
    > I've added a 2-column, 3 row table to control the placement of everything
    > on
    > the web page. The first row contains the header and spans the entire
    > width.
    > The last row contains the footer and also spans the entire width.
    >
    > I'm constructing a web page that has a header and footer across the entire
    > width of the page. Sandwiched in between these is the center row, which
    > contains a menu on the left and then the body of the page on the right.
    >
    > I explicitly set the width of the left menu to 100 pixels and I didn't set
    > any width to the right column. I assumed that this would give the menu a
    > fixed width and only the width of the right column would change. But this
    > didn't happen. So what do I need to do?
    >
    > I'm also wondering about something else: Can I programmatically change the
    > dimensions of the table? If so, how do I reference the various parts of
    > the
    > table? I did add IDs to them but don't know how to reference them.
    >
    >
    > --
    > Robert W.
    > Vancouver, BC
    > www.mwtech.com
    >
     
    S. Justin Gengo, Mar 31, 2006
    #2
    1. Advertising

  3. Your comments prompted me to test something. I pulled the essential code out
    of my aspx file and copied it into an aspx file on its own. here's the code:

    <html>
    <body>
    <form id="HomePage" method="post" runat="server">
    <table cellSpacing="0" cellPadding="0" width="100%"
    bgColor="lightsteelblue">
    <tr bgColor="royalblue">
    <td colSpan="2">Header</td>
    </tr>
    <tr>
    <td id="LeftPanel" vAlign="top" align="center" width="124"
    height="500" bgColor="aliceblue">Menu</td>
    <td vAlign="top" bgColor="lightsteelblue" >
    <h1>Home Page</h1>
    <p>The content on this page is static and defined in the .ASPX
    file.
    </p>
    </td>
    </tr>
    <tr>
    <td colSpan="2">Footer</td>
    </tr>
    </table>
    </form>
    </body>
    </html>


    *This* version of the code works properly but the original one does not. I
    really don't know what the difference is. Most mysterious!


    --
    Robert W.
    Vancouver, BC
    www.mwtech.com



    "S. Justin Gengo" wrote:

    > Robert,
    >
    > You have to give your table a width. That width could be fixed, say 800
    > pixels or it could be a percent, say 90% you can play with that.
    >
    > Here's the overall structure:
    >
    > <table width="800">
    > <tr>
    > <td colspan="2">
    > Header
    > </td>
    > </tr>
    > <tr>
    > <td width="100px">
    > Menu
    > </td>
    > <td>
    > Body
    > </td>
    > </tr>
    > <tr>
    > <td colspan="2">
    > Footer
    > </td>
    > </tr>
    > </table>
    >
    > Regards,
    >
    > --
    > S. Justin Gengo
    > Web Developer / Programmer
    >
    > Free code library:
    > http://www.aboutfortunate.com
    >
    > "Out of chaos comes order."
    > Nietzsche
    >
    >
    > "Robert W." <> wrote in message
    > news:D...
    > > I'm new to web programming so please excuse my ignorance. With that said
    > > ...
    > >
    > > I've added a 2-column, 3 row table to control the placement of everything
    > > on
    > > the web page. The first row contains the header and spans the entire
    > > width.
    > > The last row contains the footer and also spans the entire width.
    > >
    > > I'm constructing a web page that has a header and footer across the entire
    > > width of the page. Sandwiched in between these is the center row, which
    > > contains a menu on the left and then the body of the page on the right.
    > >
    > > I explicitly set the width of the left menu to 100 pixels and I didn't set
    > > any width to the right column. I assumed that this would give the menu a
    > > fixed width and only the width of the right column would change. But this
    > > didn't happen. So what do I need to do?
    > >
    > > I'm also wondering about something else: Can I programmatically change the
    > > dimensions of the table? If so, how do I reference the various parts of
    > > the
    > > table? I did add IDs to them but don't know how to reference them.
    > >
    > >
    > > --
    > > Robert W.
    > > Vancouver, BC
    > > www.mwtech.com
    > >

    >
    >
    >
     
    =?Utf-8?B?Um9iZXJ0IFcu?=, Mar 31, 2006
    #3
  4. Robert,

    If you really need to know then send through both code examples and I'll
    take a look and try to spot the difference, but if you have a working
    version you should be all set (I hope).

    Happy coding,

    --
    S. Justin Gengo
    Web Developer / Programmer

    Free code library:
    http://www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzsche


    "Robert W." <> wrote in message
    news:...
    > Your comments prompted me to test something. I pulled the essential code
    > out
    > of my aspx file and copied it into an aspx file on its own. here's the
    > code:
    >
    > <html>
    > <body>
    > <form id="HomePage" method="post" runat="server">
    > <table cellSpacing="0" cellPadding="0" width="100%"
    > bgColor="lightsteelblue">
    > <tr bgColor="royalblue">
    > <td colSpan="2">Header</td>
    > </tr>
    > <tr>
    > <td id="LeftPanel" vAlign="top" align="center" width="124"
    > height="500" bgColor="aliceblue">Menu</td>
    > <td vAlign="top" bgColor="lightsteelblue" >
    > <h1>Home Page</h1>
    > <p>The content on this page is static and defined in the .ASPX
    > file.
    > </p>
    > </td>
    > </tr>
    > <tr>
    > <td colSpan="2">Footer</td>
    > </tr>
    > </table>
    > </form>
    > </body>
    > </html>
    >
    >
    > *This* version of the code works properly but the original one does not.
    > I
    > really don't know what the difference is. Most mysterious!
    >
    >
    > --
    > Robert W.
    > Vancouver, BC
    > www.mwtech.com
    >
    >
    >
    > "S. Justin Gengo" wrote:
    >
    >> Robert,
    >>
    >> You have to give your table a width. That width could be fixed, say 800
    >> pixels or it could be a percent, say 90% you can play with that.
    >>
    >> Here's the overall structure:
    >>
    >> <table width="800">
    >> <tr>
    >> <td colspan="2">
    >> Header
    >> </td>
    >> </tr>
    >> <tr>
    >> <td width="100px">
    >> Menu
    >> </td>
    >> <td>
    >> Body
    >> </td>
    >> </tr>
    >> <tr>
    >> <td colspan="2">
    >> Footer
    >> </td>
    >> </tr>
    >> </table>
    >>
    >> Regards,
    >>
    >> --
    >> S. Justin Gengo
    >> Web Developer / Programmer
    >>
    >> Free code library:
    >> http://www.aboutfortunate.com
    >>
    >> "Out of chaos comes order."
    >> Nietzsche
    >>
    >>
    >> "Robert W." <> wrote in message
    >> news:D...
    >> > I'm new to web programming so please excuse my ignorance. With that
    >> > said
    >> > ...
    >> >
    >> > I've added a 2-column, 3 row table to control the placement of
    >> > everything
    >> > on
    >> > the web page. The first row contains the header and spans the entire
    >> > width.
    >> > The last row contains the footer and also spans the entire width.
    >> >
    >> > I'm constructing a web page that has a header and footer across the
    >> > entire
    >> > width of the page. Sandwiched in between these is the center row,
    >> > which
    >> > contains a menu on the left and then the body of the page on the right.
    >> >
    >> > I explicitly set the width of the left menu to 100 pixels and I didn't
    >> > set
    >> > any width to the right column. I assumed that this would give the menu
    >> > a
    >> > fixed width and only the width of the right column would change. But
    >> > this
    >> > didn't happen. So what do I need to do?
    >> >
    >> > I'm also wondering about something else: Can I programmatically change
    >> > the
    >> > dimensions of the table? If so, how do I reference the various parts
    >> > of
    >> > the
    >> > table? I did add IDs to them but don't know how to reference them.
    >> >
    >> >
    >> > --
    >> > Robert W.
    >> > Vancouver, BC
    >> > www.mwtech.com
    >> >

    >>
    >>
    >>
     
    S. Justin Gengo, Mar 31, 2006
    #4
    1. Advertising

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. Sean Jorden
    Replies:
    1
    Views:
    625
    laurie
    Aug 19, 2003
  2. Charleees
    Replies:
    2
    Views:
    8,280
    Eliyahu Goldin
    Jun 20, 2006
  3. Cal
    Replies:
    1
    Views:
    555
    Tim B
    Jan 8, 2007
  4. David Basford
    Replies:
    3
    Views:
    2,527
    BootNic
    Sep 30, 2007
  5. Carl Howarth

    DG Column Width vs Table Column Width

    Carl Howarth, Oct 22, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    293
    Eliyahu Goldin
    Oct 24, 2004
Loading...

Share This Page