Solved

Dynamic Sizing of a two element HTML table with one fixed in width

Posted on 2004-09-06
3
238 Views
Last Modified: 2013-12-25
Hi all,

I'm not sure where the question I composed last night went!?  Perhaps
I forgot to put in a ? title and didn't see the error that popped up and
closed the page, or didn't go far enough in the topic area?  (Only things
I can think of).  Hmmph... Anyway...

I have a website that I am developing that employs a Java/DHTML menu system.
Now what I wanted to do seemed simple enough on the surface but isn't.
This menu system is left aligned and is 150 pixels wide.  This menu draws on
the screen overwriting anything that may be underneath it.  The problem is, I want
to be able to use a table with two field elements.  The left one sized to 150 pixels
wide (so that I can insert text/images below or above said menu), and the other to
size dynamically using the current IE browser window width - the 150 pixels for the
menu (for putting in site content).

When I specify the width in % for the second element, it does not work since it will size
according to the entire width of the browser window, and not - the 150 pixels (the
way I want it to).  Is there a way to size the second element dynamically?  What I am
looking for is code that can determine the browser window width that I can then pull
out with a variable.  Something along the lines of what is seen below.  I could have
sworn there was a way to do this in VBScript but perhaps I am mistaken?!  I know
it could be done using native VB and compiling to ActiveX DLL, but that is not an
option.

Any help is greatly appreciated!

TIA,
Bob

<TABLE BGCOLOR="#000000" CELLSPACING="0" CELLPADDING="0" BORDER="1" BORDERCOLOR="#FFFFFF">
  <TR>
      <TD WIDTH="150px">&nbsp;</TD>
      <TD WIDTH="<%=Variable%>">Some Content</TD>
  </TR>
</TABLE>
0
Comment
Question by:sharizod
  • 2
3 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 250 total points
ID: 12011907
<TABLE style="table-layout:fixed;width:100%" BGCOLOR="#000000" CELLSPACING="0" CELLPADDING="0" BORDER="1" BORDERCOLOR="#FFFFFF">
  <TR>
      <TD WIDTH="150px">&nbsp;</TD>
      <TD>Some Content</TD>
  </TR>
</TABLE>



Cd&
0
 
LVL 1

Author Comment

by:sharizod
ID: 12012534
Wow!  I just knew there had to be a simple way to do it!!!  Thanks!!!!
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 12016158
Glad I could help.  Thanks for the A. :^)

Cd&
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Uploading files to the web server has become common part of almost any kind of web application. People use different technologies to solve this, but regardless of the technology used, it is always useful to have some kind of progress indicator shown…
Accessibility and Usability are two concepts that seem to be closely related.  But, too many people seem to have a distorted perception of them. During last five years, those two words have come to the day-to-day work of almost every web develope…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now