Combining Fixed and Relative Widths in Table

liunx

Guest
Alright. Here's the rundown of what I want to do.<br />
<br />
I have a website that will have two columns. One will act as a sidebar and one will act as the main content area. Obviously, I want the content area to be larger. What I would like is to have the column on the left be fixed at a width of 150 pixels. This column will be the sidebar containing site links. I would like the other column to take up the rest of the table, no matter how large the browser window.<br />
<br />
That's not too much to ask for, is it?<br />
<br />
You can see my attempt at <!-- w --><a class="postlink" href="http://www.whoisandy.com">www.whoisandy.com</a><!-- w -->. Yeah, I know the HTML code is a bit sloppy, but what can ya do. Basically, what I have done is this:<br />
<br />
<TABLE><br />
<TR><br />
<TD WIDTH="150">Sidebar</TD><br />
<TD WIDTH="100%">Main Text</TD><br />
</TR><br />
</TABLE><br />
<br />
However, I don't get the effect I am looking for. If you go to the URL I pointed out earlier (click here for it (<!-- m --><a class="postlink" href="http://www.whoisandy.com">http://www.whoisandy.com</a><!-- m -->)) You can see that the column on the left grows with the size of the browser window. It should remain the width of those green boxes, but instead, stays somewhat relative to the browser window.<br />
<br />
If anyone has any suggestions, I would greatly apprecate them.<br />
<br />
Thanks a lot!<br />
<br />
~ Andrew Tomaka<!--content-->try this for your table<br />
<br />
<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" width="100%"><br />
<tr><br />
<td width="150">Sidebar</td><br />
<td>Main text</td><br />
</tr><br />
</table><!--content-->No such luck. I receive the same results when I do so.<!--content-->with the code on that page every width (other than for the spacers) is either 100% or 95%....with them being in as a "%" they will move....you have to set them to be an exact size...with them being an exact pixel size they will not move...if you tell something to be 100 pixels wide it will be 100 pixels wide no matter if the window size is 50 or 500 pixels wide<!--content-->The 100%s that you are referring to are only relative to the TD size (which is 150) so that shouldn't have any effect on the width of that TD. However, I attempted to change all 100% to 150 on <!-- w --><a class="postlink" href="http://www.whoisandy.com">www.whoisandy.com</a><!-- w --> and you can see that the results are still the same.<br />
<br />
But actually, no, you cannot see the results anymore. It seems that I was being an idiot. I had mistakingly left the table width of 545px in the style sheet for that TDs class. Wow...<br />
<br />
Sorry to trouble you all and thanks for your help huwey.<!--content-->lol....well glad you figured out what was wrong<!--content-->Hmm. There are many other errors. You really need to fix most of this stuff (<!-- m --><a class="postlink" href="http://validator.w3.org/check?uri=http%3A%2F%2Fwww.whoisandy.com.%2F&charset=%28detect+automatically%29&doctype=HTML+4.01+Transitional&ss=1&outline=1&sp=1">http://validator.w3.org/check?uri=http% ... ine=1&sp=1</a><!-- m -->). It includes things like <ttd><tr>, an obvious typo, missing elements, unquoted "50%" sizes, missing closing tags, and usage of a disallowed character (&#146;). See this link (<!-- m --><a class="postlink" href="http://validator.w3.org/check?uri=http%3A%2F%2Fwww.whoisandy.com.%2F&charset=%28detect+automatically%29&doctype=HTML+4.01+Transitional&ss=1&outline=1&sp=1">http://validator.w3.org/check?uri=http% ... ine=1&sp=1</a><!-- m -->) for a full list.<br />
<br />
Post again if you need help fixing any of this.<!--content-->
 
Back
Top