Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Newbie Question About Setting Table Column Width

Reply
Thread Tools

Newbie Question About Setting Table Column Width

 
 
=?Utf-8?B?Um9iZXJ0IFcu?=
Guest
Posts: n/a
 
      03-31-2006
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

 
Reply With Quote
 
 
 
 
S. Justin Gengo
Guest
Posts: n/a
 
      03-31-2006
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." <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
 
 
 
=?Utf-8?B?Um9iZXJ0IFcu?=
Guest
Posts: n/a
 
      03-31-2006
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." <(E-Mail Removed)> wrote in message
> news(E-Mail Removed)...
> > 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
> >

>
>
>

 
Reply With Quote
 
S. Justin Gengo
Guest
Posts: n/a
 
      03-31-2006
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." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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." <(E-Mail Removed)> wrote in message
>> news(E-Mail Removed)...
>> > 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
>> >

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
picture width decides table column width David Basford HTML 3 09-30-2007 10:49 PM
How to set table column width except the last column? Cal Java 1 01-08-2007 06:55 AM
setting Column width of Template Column in Datagrid.. Charleees ASP .Net 2 06-20-2006 12:52 PM
DG Column Width vs Table Column Width Carl Howarth ASP .Net Datagrid Control 1 10-24-2004 08:48 AM
Re: resized image in table extends table width to original image width Sean Jorden HTML 1 08-19-2003 08:59 AM



Advertisments