Home > Archive > ASP .NET > March 2006 > Newbie Question About Setting Table Column Width
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Newbie Question About Setting Table Column Width
|
|
| Robert W. 2006-03-31, 7:03 pm |
| 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 2006-03-31, 7:03 pm |
| 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." <RobertW@discussions.microsoft.com> wrote in message
news:DC434988-B4F0-4A20-BA5D-45966E9C15D7@microsoft.com...
> 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
>
| |
| Robert W. 2006-03-31, 7:03 pm |
| 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." <RobertW@discussions.microsoft.com> wrote in message
> news:DC434988-B4F0-4A20-BA5D-45966E9C15D7@microsoft.com...
>
>
>
| |
| S. Justin Gengo 2006-03-31, 7:03 pm |
| 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." <RobertW@discussions.microsoft.com> wrote in message
news:6BA577DB-71E9-47A7-AC24-A9C6007F3EA2@microsoft.com...[color=darkred]
> 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:
>
|
|
|
|
|